• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inactive DB Connection issue

 
Anand Bhatt
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
 
Paul Sturrock
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

 
Smd Muneer
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic