Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
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?
Hello,
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.
Regards
ok, thanks :|
I tried to wrap C3P0 into a JDBCConnectionPool - but that breaks filtertable addon !?
TableQuery query = new TableQuery("lager", pool);
query.setVersionColumn("OPTLOCK");
SQLContainer container = new SQLContainer(query);
filterTable.setContainerDataSource(container);
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 :|
class C3POJDBCConnectionPool implements JDBCConnectionPool {
public C3POJDBCConnectionPool () { //setup the pool, not shown but simple URL and password }
@Override
public Connection reserveConnection() throws SQLException { return cpds.getConnection(); }
@Override
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 ?