This discussion is archived
9 Replies Latest reply: Aug 22, 2012 2:37 AM by 844001 RSS

ORA-12571: TNS: Packet writer failure with ASP .NET 4.0

783625 Newbie
Currently Being Moderated
Hello everyone! I really need urgent help here!
I have an ASP .NET Web Application (4.0) and when someone makes an insert or update operation in any page, the Oracle Client returns this message:

Oracle.DataAccess.Client.OracleException ORA-12571: Packet writer failure

The real issue is that this error doesn't show eveytime, it only shows when the user opens the page, wait some minutes and makes the operation. When the user opens the page and immediatly makes the operation, everithing goes well.

I have tried everything: reistall the client, try with the Web site in another server, disabling the antivirus in the server and specifying the database server in TSNAMES.ORA file. Nothing works! The error keeps displaying eventually!

What else can I do?

Thanks in advance!

Edited by: user1079748 on Jul 7, 2010 9:55 AM

Edited by: user1079748 on Jul 7, 2010 9:56 AM
  • 1. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    gdarling - oracle Expert
    Currently Being Moderated
    Hi,

    There isnt a production version of ODP that is currently certified with .NET 4. The 11.2 ODAC bundle (currently in beta) will be the first to support .NET 4.

    What is the difference between a user opening a page and waiting, compared to openening a page and immediately performaning an operation? You're opening/using/disposing the connection in the page itself, so basically you do two operations back to back or two operations with a delay, but it's still two distinct operations right?

    Typically, the firewall is suspect in issues that occur after a connection sits idle, and ODP has connection pooling on by default so idle connections can certainly occur. Assuming there's a firewall in between the app server and the DB, you may want to check with your network guys to see if the firewall is sniping idle connections.

    You could also try setting "validate connection=true" in your connect string, which will force ODP to validate the connection by round-tripping to the server every time you get a connection from the pool, but as such also has some overhead.

    As a more drastic measure, turning off connection pooling will likely resolve it as well, but pooling is a good thing.

    Hope it helps,
    Greg

    Edited by: gdarling on Jul 7, 2010 10:08 AM
    Also, future ODP questions would be best directed to the ODP forum, located at ODP.NET
  • 2. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    783625 Newbie
    Currently Being Moderated
    Hi Greg! Thanks for your response.

    Well, I'm actually using the 11.2 beta ODAC bundle. But there's another thing that I forgot to explain before. This issue started to show after moving out the Oracle database server. Before, we have the server here in our office, but now we moved out the server to Amazon and in that moment the issue appeared. When the server was here in the office, I upgraded the application to .NET 4 and everything went well.

    Exactlly, I know there's no differece. That's why I found this issue really strange. The opening/using/disposing process is happening in the page itself when the operation is performed by the user. And no, in both cases it's the same operation.

    I've also checked the firewall logs whit the network guys and, the firewall is not blocking anytihing too.

    I will try adding the "validate connection" parameter in the connection string, that's something I haven't tried.
  • 3. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    783625 Newbie
    Currently Being Moderated
    Thanks a lot Greg! It works!
    I added the "validate connection" parameter in the connection string and now it workes fine! No more TNS failure.

    Just for learning, I have one final question for you... how exactly the "round-tripping" you mentioned works? and why this turns in some overhead?

    Again, thanks a lot!
  • 4. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    gdarling - oracle Expert
    Currently Being Moderated
    Hi,

    Validate Connection forces a server round trip by doing a database operation to make sure the connection is still alive. I think it does "select 'x' from dual" if I remember right.
    It adds overhead because a network round trip occurs to the database every time you call con.Open (regardless of whether that connection actually had issues or not), which obviously introduces some delay while waiting for that call to complete.

    Hope it helps,
    Greg
  • 5. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    Greg's suggestion of validating the connection is only a workaround and it adds an extra round trip.

    If you want to solve this problem, contact your DBA (as this is likely a server side issue) and have him open a ticket with Oracle Support (networking). There are quite a few networking issues that could be causing this. You probably want to solve this correctly, because if enough connections are going bad, it will really slow down your application.

    Thanks,
    Christian
  • 6. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    659476 Newbie
    Currently Being Moderated
    Hi Greg.

    I have a similar problem that someone reported.

    I have an application using a Web Service that connects to an Oracle database using. Net Oracle Data Provider for Visual Studio 2005. The Web service I've installed on a Windows 2000 Server. When I perform simple queries does not show the error, but when I do CRUD operations on the database or run some complex queries shows the error "ORA-12571: TNS: packet writer failure". Not so when using the Web Service in my station. Please, I need some assistance. Thanks in advance.
  • 7. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    user6752145 wrote:
    Hi Greg.

    I have a similar problem that someone reported.

    I have an application using a Web Service that connects to an Oracle database using. Net Oracle Data Provider for Visual Studio 2005. The Web service I've installed on a Windows 2000 Server. When I perform simple queries does not show the error, but when I do CRUD operations on the database or run some complex queries shows the error "ORA-12571: TNS: packet writer failure". Not so when using the Web Service in my station. Please, I need some assistance. Thanks in advance.
    Have you contacted your DBA so he can look at server side traces?

    This kind of networking issue is complex and will require the help of an Oracle expert.
  • 8. Re: ORA-12571: TNS: Packet writer failure with Visual  Studio 2010
    827823 Newbie
    Currently Being Moderated
    I have been learning oracle over the acadmic year and only just started to use oracle database. i have installed oracle 10g express edition on my Laptop and using visual studio 2010.

    I have installed 32-bit Oracle Data Access Components (ODAC)
    with Oracle Developer Tools for Visual Studio

    and when i try connecting via visual studio 2010 i get this error message ORA-12560: TNS:protocol Adapter error

    Things i have tried but still no change.
    I have confirmed that the oracle server service is started and running.


    What could be the course of this problem? could it be because i am using a x64 bit Windows 7 operating system and x64bit visual studio 2010? i cannot tell if the oracle 10g express edition ii installed is 32 bit or 64 bit but this is de exact download link i got it from http://www.oracle.com/technetwork/database/express-edition/downloads/102xewinsoft-090667.html

    Please help.. i am stranded on this.
  • 9. Re: ORA-12571: TNS: Packet writer failure with ASP .NET 4.0
    844001 Newbie
    Currently Being Moderated
    change the sqlnet.ora file as
    SQLNET.AUTHENTICATION_SERVICES = (NONE)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points