Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes Inactive DB Connection issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Inactive DB Connection issue" Watch "Inactive DB Connection issue" New topic
Author

Inactive DB Connection issue

Anand Bhatt
Ranch Hand

Joined: May 30, 2007
Posts: 189
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

Joined: Apr 14, 2004
Posts: 10336

Can you show us your code? It's not clear (to me anyway) from your description exactly what you are doing.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Anand Bhatt
Ranch Hand

Joined: May 30, 2007
Posts: 189
Below is pusedo code for make things more clear:


Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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

Joined: May 30, 2007
Posts: 189
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

Joined: Oct 05, 2007
Posts: 8
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.


Thanks & regards,
SMD Muneer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Inactive DB Connection issue
 
Similar Threads
Active/Inactive a record
Inactive DB Connection issue
JDBC connection in Oracle db
FixedThreadPool issue: more threads then expected seems to be working
JDBC connection in Oracle db