asp.net - oracle (OracleTransaction has completed; it is no longer usable) RRS feed

  • Question

  • User1527693392 posted

    Hi guys,

    We've developed an ASP web application used by 10-20 users at the same time. The connection to Oracle database is configured using ConnectionString indicated on the Web.config file. So, all the users get the same connection to acces to database.

    We don't know when and why, but after a couple of hours the web throws the error "OracleTransaction has completed; it is no longer usable". Then, if we re-start the IIS where the web site is located, the error is solved.

    Do you've some ideas about what could be the problem????

    Thanks in advance!

    Wednesday, September 28, 2011 6:13 AM

All replies

  • User-837620913 posted

    Almost every Oracle class (Connection, OracleTransaction, etc.) implements IDisposable.  You MUST call dispose on every one of those objects, or use a using statement to automatically call dispose on it.  When you restart IIS, you clean up all of those connections.

    Wednesday, September 28, 2011 6:21 AM
  • User1527693392 posted

    Do you mean the error is caused due to not dispose the connection?

    We don't close the connection anytime because as it's shared by all the users, if we close it and other user is reading from database will throw a connection error.

    Wednesday, September 28, 2011 6:53 AM