LucaMs Expert Licensed User Longtime User Mar 26, 2016 #1 In a code module I have a regular routine containing only a Select. I open a connection to the db (MySql) and I close it after the query execution. Code: Copy Sub XYZ Private sq As SQL = pool.GetConnection '<...> Private Cursor As ResultSet = sq.ExecQuery(Query) '<...> sq.Close End Sub Exactly at the fifteenth call to this routine I get the timeout error while trying to get a connection: Error occurred on line: 223 (modDB) java.sql.SQLException: An attempt by a client to checkout a Connection has timed out. ... at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) ... Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@2ef9b8bc -- timeout at awaitAvailable() (line 223 Private sq As SQL = pool.GetConnection). It's not a time matter, I tried to wait between the calls. It's possible that the Close statement does not release the connection? [mysql-connector-java-5.1.32-bin.jar] Last edited: Mar 26, 2016
In a code module I have a regular routine containing only a Select. I open a connection to the db (MySql) and I close it after the query execution. Code: Copy Sub XYZ Private sq As SQL = pool.GetConnection '<...> Private Cursor As ResultSet = sq.ExecQuery(Query) '<...> sq.Close End Sub Exactly at the fifteenth call to this routine I get the timeout error while trying to get a connection: Error occurred on line: 223 (modDB) java.sql.SQLException: An attempt by a client to checkout a Connection has timed out. ... at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) ... Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@2ef9b8bc -- timeout at awaitAvailable() (line 223 Private sq As SQL = pool.GetConnection). It's not a time matter, I tried to wait between the calls. It's possible that the Close statement does not release the connection? [mysql-connector-java-5.1.32-bin.jar]
somed3v3loper Well-Known Member Licensed User Longtime User Mar 26, 2016 #2 I think you need this ? Code: Copy Cursor.Close sq.TransactionSuccessful Upvote 0
LucaMs Expert Licensed User Longtime User Mar 26, 2016 #3 somed3v3loper said: I think you need this ? Code: Copy Cursor.Close sq.TransactionSuccessful Click to expand... Thank you but I close the cursor and I don't use a transaction in that routine Also I suppose sq.close also closes them. Upvote 0
somed3v3loper said: I think you need this ? Code: Copy Cursor.Close sq.TransactionSuccessful Click to expand... Thank you but I close the cursor and I don't use a transaction in that routine Also I suppose sq.close also closes them.
LucaMs Expert Licensed User Longtime User Mar 26, 2016 #4 Good "news": I tried just that routine, removing all the rest of my project (from the server and from the client) and... now it works. Bad "news": who knows where is the bug, then! Last edited: Mar 26, 2016 Upvote 0
Good "news": I tried just that routine, removing all the rest of my project (from the server and from the client) and... now it works. Bad "news": who knows where is the bug, then!
somed3v3loper Well-Known Member Licensed User Longtime User Mar 26, 2016 #5 Check this http://stackoverflow.com/questions/14105932/c3p0-hangs-in-awaitavailable-with-hibernate I am not sure if it is related Upvote 0
Check this http://stackoverflow.com/questions/14105932/c3p0-hangs-in-awaitavailable-with-hibernate I am not sure if it is related
LucaMs Expert Licensed User Longtime User Mar 26, 2016 #6 Found the bug: in another routine I had not closed the connection Thank you. Upvote 0