Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Inactive DB Connection issue

 
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
Hibernate Eclipse IDE 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
Hibernate Eclipse IDE 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic