Intermittent Disconnects Using MySQL 5

Hello,

I recently switched from Sybase to MySQL, and on my developer Mac I’m occasionally seeing the following error messages:

com.servoy.j2db.persistence.RepositoryException: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: 

** BEGIN NESTED EXCEPTION ** 

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:168)
	at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
	at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
	at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1910)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
	at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5215)
	at com.servoy.j2db.persistence.datasource.l.setAutoCommit(Unknown Source)
	at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:237)
	at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:237)
	at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:237)
	at com.servoy.j2db.persistence.datasource.TransactionConnection.startTransaction(Unknown Source)
	at com.servoy.j2db.persistence.Repository.a(Unknown Source)
	at com.servoy.j2db.persistence.Repository.createRootObject(Unknown Source)
	at com.servoy.j2db.persistence.Repository.createSolution(Unknown Source)
	at com.servoy.j2db.develop.J2DBDeveloper.newSolution(Unknown Source)
	at com.servoy.j2db.develop.c.bn.doIt(Unknown Source)
	at com.servoy.j2db.cmd.c$2.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


** END NESTED EXCEPTION **

I’m using the following setup:
Mac OS X 10.4.8
Servoy 3.0 final
MySQL 5.0.24a
Latest MySQL driver (5.0.3 – mysql-connector-java-5.0.3-bin.jar)
Pointed my DB Servers to the new driver (com.mysql.jdbc.Driver instead of org.gjt.mm.mysql.Driver)

I usually have to restart Servoy to resolve the issue. Any ideas?

Did you try allready a Query Validation with ‘SELECT 1’ on all of your mySQL connections?

(can set this in the servoy-admin pages)

Hi Harjo,

Thanks for the prompt reply. No, I didn’t try that already. so thanks for the suggestion. After reading the following Servoy Magazine article again, I noticed that the author (Nicola Gervasi) recommends the same thing:
http://www.servoymagazine.com/home/2006 … rvoy_.html

So, apparently the timeout bug that existed in previous versions of the MySQL driver is still there. I notice the bug when I first arrive in the morning, which means my machine was idle for a while. Harjo, do you use MySQL as your back-end database? Just curious.

chartpacs:
Harjo, do you use MySQL as your back-end database? Just curious.

Nope, we always use Sybase Ianywhere.