TableQuery and idle pool / JDBCConnectionPool problem

I have a issue with the JDBCConnectionPool and mysql.

Every morning the parts of my vaadin application that uses TableQuery/JDBCConnectionPool
does not work since the connections in the pool has been closed by the myslserver due to inactivity. Other parts not using this pool works fine.
Should the pool not figure this out and drop the connections and create new ones?


If you are using SimpleJdbcConnectionPool, according to source code, it does not handle such a disconnection.
You should implements your own connectionPool, may be using some existing one.


ok, thanks :expressionless:

I tried to wrap C3P0 into a JDBCConnectionPool - but that breaks filtertable addon !?

TableQuery query = new TableQuery(“lager”, pool);
SQLContainer container = new SQLContainer(query);

if the pool is a SimpleJDBCConnectionPool then the filtertable works. Its loading and I can filter. If I change it to my wrapped class below, it does load the data but all filtering does not work :expressionless:

class C3POJDBCConnectionPool implements JDBCConnectionPool {

public C3POJDBCConnectionPool () { //setup the pool, not shown but simple URL and password }

public Connection reserveConnection() throws SQLException { return cpds.getConnection(); }

public void releaseConnection(Connection connection) { try { connection.close(); } catch (SQLException e) { e.printStackTrace(); } }

@Override public void destroy() { cpds.close(); }


Did you find what was going wrong ?
Do you have some error / stacktrace ?