• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Connectin leak

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 218
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you share complete configuraiton (applicaiton-context.xml).
Can you also share the test case that you are executing.
 
avseq anthoy
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic