• 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

Unable to Close Connection In Case Of java.sql.Exception

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using weblogic 7.1, Struts, JDBC Thin , Oracle 8i.
Whenever I am getting an exception " java.sql.SQLException: ORA-02392: exceeded session limit on CPU usage, you are being logged off
" and I am trying to close the connections in the finally clause it is not closing.
Due to which jdbcConnectionPoolRuntimeMbean.getLeakedConnectionCount() is always giving me an open connection and this count goes on increasing in whenever this exception occurs.
Now My Question is :
1) Is there an actual connection leak ?
Thanks in advance for help.
Regards,
Shakti
 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

and I am trying to close the connections in the finally clause it is not closing.



This is only possible if exception occurs before try block starts.

The other problem I can think is your application may have too many requests(ie. threads) which always surpassed your max connection capacity before they are available from other running thread.

If that is the cases you might want to use some load balancing tool(ie. JProfiler) to get the idea of max capacity of your production machine.
 
Shakti Dalabehera
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jignesh for your reply. You are right I am getting this oracle error because too many people are logged in with the same id using TOAD . So I guess i wont' face this issue in production.

But actually I didn't get the answer for question. My Questions is " In the finally clause I have written connection.close() ... and in such a scenario weblogic is throwing an SQL exception while I am trying to close the connection. But when I am checking for any connection leaks using weblogic api ( this is a separate monitoring tool ) I am getting a connection leak .
Please let me know if this is a geniune case of Connection Leak ?
Regards,
Shakti
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic