Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes Connectin leak Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Connectin leak" Watch "Connectin leak" New topic
Author

Connectin leak

avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Dear all

I use Spring 2.5.6 + Hibernate 3.2.GA to implement the application.
And I use the declared transaction in spring , configuration as below


Because I must control the information should be saved when System occurs exception, so I should declare some action to PROPAGATION_REQUIRES_NEW. When I execute the performance , it always show the exception as below


Because the transaction is controlled by Spring, I didn't how to check whether it will release the connection after the transaction complete.

Can someone tell me how to resolve the connection leak problem/

thanks~

Best Regards


My Way,My Pace
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Can you share complete configuraiton (applicaiton-context.xml).
Can you also share the test case that you are executing.
avseq anthoy
Ranch Hand

Joined: Apr 27, 2004
Posts: 104
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

The problem does not seem to be of leaking connections, from what you have posted it seems like the Spring is not able to get connections while trying to start the transaction.
I don't think that the problem is with Spring not releasing connections, Spring aquires a connection on start of transaction releases it back on completion of transaction.

You are using DriverManagerDataSource, which actually does not pool connections, it creates connections on demand.
In case you are running in J2EE container you should look up datasource via JNDI or if you are not running application in container consider using Apache's Jakarta
Commons DBCP or C3P0 connection pool implementations.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connectin leak
 
Similar Threads
org.jboss. util.NestedSQL Exception
Jboss connection pool not releasing the connection from pool
Getting org.jboss.util. NestedSQLException : No ManagedConnections available
How to wire-up TransactionProxyFactoryBean & HibernateInterceptor ?
Spring-Struts Issue