B4J Question update mysql-connector ?

marcick

Well-Known Member
Licensed User
Longtime User
In JRDC2 is declared #AdditionalJar: mysql-connector-java-5.1.37-bin

but I see it is available a new version mysql-connector-java-8.0.18

Does it make sense to update it ?
My JRDC2 server app sometimes (after many days or weeks) crash with strange errors like this and I was wondering if updating the mysql-connector could help

B4X:
2019-12-12 17:11:49 - RDCHandler_Handle error, method query2, (TimeoutException) com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@6615435c -- timeout at awaitAvailable()
2019-12-12 17:11:50 App Error 2: (SQLException) java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
(SQLException) java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)
    at anywheresoftware.b4j.object.ConnectionPool.GetConnection(ConnectionPool.java:45)
    at jrdc.bmap4aw.rdcconnector._vvvvvvvvvvvvvvvvvv5(rdcconnector.java:71)
 

OliverA

Expert
Licensed User
Longtime User
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Hi OliverA. This is an old recurring issue. I'm sure there is something of wrong in my code but I still have to understand.
Difficult to follow those suggestion ... for now I just wanted to know if does it make sense to update the mysql-connector.

Also would be interesting to know if there is a B4j code that can monitor the number of opened connection, so when I capture the crash I print it and see if the problem is this or not.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Thanks.
MySql version is 5.7
I will use mysql-connector-java-8.0.18 instead of the original mysql-connector-java-5.1.37
 
Upvote 0
Top