• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Inactive DB Connection issue  RSS feed

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have one for loop that runs for 3000 times ,inside that loop I I am opening db connection(simple JDBC),and at the last inside finally block I am closing all db resources(statement,resultset and connectionproperly.
The issue is that in the inactive database connection mounting to somr 500 and appliction tossed up.
What the wrong I a am doing here?
Using: Jsp,Struts1.2,JDBC andOracle database
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us your code? It's not clear (to me anyway) from your description exactly what you are doing.
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is pusedo code for make things more clear:


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, your pseudo-code makes sense, so this should not be holding on to connections. So it must be your real code that is at fault. Can you post that?
 
Anand Bhatt
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is the code snippet where using DB resources and and closing same by calling one generic method.
DAO file:



2: ConnectionManager.java

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anand,

I am also facing similar kind of issue for our application. Please help me if you got any solution for this type of issue.

Thanks in advance.

Thanks & regards
Muneer.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!