• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Closed Connection

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In our aplication we are recieving the following closed connection exception randomly.
java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:976)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:883)
at weblogic.jdbc.pool.Connection.prepareStatement(Connection.java:393)

And this exception is thrown from different class. But when the same screen is accessed again then these exceptions arent thrown. This happens wehn the application uis loaded with more users.
We are using weblogic 7.0 and database Oracle 9i. JDK1.4 and JDBC version 9.0.2.0.0

Is this because of a connection breakage between the appl server and db server? Though when thse above error occurs, i could connect to database from sql plus.

I see an option in weblogic to test Reserved/Released connection; if we enable this option, will it have any adverse effect in the application performance > I believe this will validate the connection everytime the client request for a new conenction from the weblogic pool.
Please throw some light.

Thanks
vishy
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Viswa,

Check the connection pool settings ( Inactive Connection Timeout ). This value should ideally be zero. This might be a probable reason for the database connection to get closed even before any transaction completes. The parameter "Inactive Connection Timeout" will be set to any positive integer ( in seconds ) if the application code did not explicitly close the database connection after usage. If you are sure that there are no database connection leaks in your application, then you can very well go ahead and set the value of "Inactive Connection Timeout" to zero.

Hope this helps.

BK Sella
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The WLS Out-Of-Box (OOB) settings would normally suffice. Hence, I would instead, recommend that you look into your coding. Endure that your code is not doing the closing pre-maturely and review that the code is not taking exceedingly long time at accessing the database. Also, check your SQL, make sure that they're not the culprits.
 
Hey cool! They got a blimp! But I have a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic