This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes timeout error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "timeout error" Watch "timeout error" New topic
Author

timeout error

rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
At times I am getting the following error in my application - com.ibm.ejs.cm.pool.ConnectionWaitTimeoutException: Timeout waiting for free connection
I am using DataSource to connect to the oracle database. Ihave used this finally block to close the connection once its done. Is it necessary to close ResultSet and Statement objects also..??


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
Surendran Velath
Greenhorn

Joined: Apr 23, 2003
Posts: 19
You may use -
DriverManager.setLoginTimeout(seconds)
to increase the wait time
Also
Tune the connection pool and database as per requirements of your application
You may retry the getConnection() but is not advisible
conn.close() closes all your statements and resultsets automatically
Taudo Wenzel
Greenhorn

Joined: Mar 06, 2001
Posts: 8
Originally posted by Parmeet Sarpal:
At times I am getting the following error in my application - com.ibm.ejs.cm.pool.ConnectionWaitTimeoutException: Timeout waiting for free connection
I am using DataSource to connect to the oracle database. Ihave used this finally block to close the connection once its done. Is it necessary to close ResultSet and Statement objects also..??

Hi Parmeet,
it is very important that you close your Statement and ResultSet objects.
You can get into big time trouble not doing it, especially - and that is for sure - if you are using a connection pool. Closing a Connection obtained from a connection pool does NOT close the connection and release all used resources. Consequence is that you will have a memory leak.
This is a very common error in JDBC programming.
Regards,
Taudo
 
Have you checked out Aspose?
 
subject: timeout error
 
jQuery in Action, 3rd edition