Results 1 to 3 of 3
- 12-14-2010, 07:21 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 2
- Rep Power
- 0
MySQL connection via Hibernate is timed out frequently
I am connecting to MySql using Hibernate and every 8 hours the connection is timed out. I am getting com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption. It also display very big error message. "The last packet successfully received from the server was 437,036,648 milliseconds ago......."
If i restart my application, things will work fine. Please help me out.
- 12-15-2010, 01:50 AM #2
are you using a database connection pool, such as commons-pool.
they support a "test on borrow" mechanism where the connection in the pool is tested with a "validation query" before it is given to the requesting application. This facility works to remove these sql error messages from the application, as it opens the connection again as needed.
see also: DBCP - Commons Wiki
but i;m sure other connection pool implementations support something like test on borrow and validation query as well
- 12-15-2010, 06:09 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
The issue is due to your connection pool library timing out the database connection. You need to test or validate it. Check out the article to set the relevant properties in c3p0 file.
Similar Threads
-
javamail, Connection timed out
By OmerHalit in forum NetworkingReplies: 11Last Post: 04-12-2010, 07:02 AM -
Connection Timed Out
By sukatoa in forum NetworkingReplies: 2Last Post: 10-27-2009, 03:20 PM -
connection timed out in my java code
By santhosh_el in forum AWT / SwingReplies: 4Last Post: 10-22-2009, 12:24 PM -
solution for connection timed out
By santhosh_el in forum NetworkingReplies: 0Last Post: 10-03-2009, 07:55 AM -
i am getting connection timed out
By santhosh_el in forum NetworkingReplies: 1Last Post: 08-25-2009, 06:57 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks