Howto use a Tomcat connection pool with Toplinks essentials`
665845Dec 16 2008 — edited Jan 8 2009I have a Webapp on Tomcat using JPA (Toplink essentials). I use mysql 5 as db and I have created a dbcp connectionool in the context.xml of Tomcat. I use all kinds of possible parameters available (example: testOnBorrow, etc.) but after a while of running, the app throws sql exception like this following one:
Internal Exception: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1956) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708) at com.mysql.jdbc.Connection.execSQL(Connection.java:3255) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1293) at
....
I ask myself now whether this is love's labour's lost because it looks as if toplink does not use the pool.
Does anybody can tell me that whether this is true? And if so, which are the ways to make toplink to use it?
Maybe there are other mechanisms in toplinks? I saw properties like "toplink.jdbc.write-connections.max". The explanations are too vague to sense whether it can be used for my purposes to have a pool of workable connections.
Thanks for hints or explanations in advance.
chk