JDBC Bounces

I’m getting bounced by my MySQL db hosted at my ISP with errors like this:

java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2244)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2204)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2185)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1572)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.servoy.j2db.persistence.datasource.p.invoke(Unknown Source)
at $Proxy1.executeQuery(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.for(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.browseAll(Unknown Source)
at com.servoy.j2db.FormPanel.j(Unknown Source)
at com.servoy.j2db.FormPanel.loadAllRecords(Unknown Source)
at com.servoy.j2db.cmd.ag.doIt(Unknown Source)
at com.servoy.j2db.FormManager$6.run(Unknown Source)
at com.servoy.j2db.util.aq.run(Unknown Source)
at java.lang.Thread.run(Thread.java:552)

** END NESTED EXCEPTION **

Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1394)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1538)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1929)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1224)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2244)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2204)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2185)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1572)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.servoy.j2db.persistence.datasource.p.invoke(Unknown Source)
at $Proxy1.executeQuery(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:179)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.for(Unknown Source)
at com.servoy.j2db.dataprocessing.FoundSet.browseAll(Unknown Source)
at com.servoy.j2db.FormPanel.j(Unknown Source)
at com.servoy.j2db.FormPanel.loadAllRecords(Unknown Source)
at com.servoy.j2db.cmd.ag.doIt(Unknown Source)
at com.servoy.j2db.FormManager$6.run(Unknown Source)
at com.servoy.j2db.util.aq.run(Unknown Source)
at java.lang.Thread.run(Thread.java:552)

** END NESTED EXCEPTION **

The symptoms at the Servoy end are that the form shows its field structure in design and user mode but no data presents itself or is editable although the controller seems to know how many records are present.

At this stage I don’t understand where the problem is ocurring. How does one diagnose this stuff?

Are you using the latest version of the mysql driver? You can get the latest here:

http://dev.mysql.com/downloads/connector/j/3.0.html

extract the tar.gz and find the binary jar in it. Put that in your drivers directory and remove the old mysql.jar.

Yes, I believe I am: mysql-connector-java-3.0.15-ga-bin.jar, which then offers me two drivers in the db services panel of the preferences. I can choose the com.mysql.jdbc.Driver or com.mysql.jdbc.NonRegisteringDriver which doesn’t seem to make a difference.

just now I’m getting this message:

Cannot find table member (is undefined or missing) from server acsp_xoops_remote

Which is odd since member certainly isn’t in that database. Instead its in a database that I’m linking to via a relation. I’ve just deleted all of the relations and will rebuild them. (update: that didn’t work, the form still thinks the data is coming from the wrong database)

Do Servoy objects get corrupted? If so can one fix them or is it a delete and rebuild?

Do you always get that mysql error or only sometimes (for example if you haven’t used a connection to mysql for some time)

When do get that cannot find table member?
Can you reproduce that?

Now I’ve just rebuilt the solution from scratch including the data sources and when I swap out of designer mode into the sportiva.memberentry form I immediately get the java error described at the top of this thread, so now I’m guessing its an issue with remote access to my webhost’s MySQL server. Then again, I can attach to that database and quite happily edit the data with any SQL tool (eg CocoaSQL).

jcompagner:
Do you always get that mysql error or only sometimes (for example if you haven’t used a connection to mysql for some time)

Whenever swapping from design to user mode or after some idle time

When do get that cannot find table member?
Can you reproduce that?

Yes, but not since I rebuilt the solution

Update - 11/11/04 17:47
Playing around with the forms more reveal a patern of failure: it seems that after some design work the first attempt to swap to user from designer mode provokes the java error. Subsequent attempts (must swap to designer and back again) seem to succeed but this is not 100% guaranteed. This is on forms with all data coming from columns in the one table. My previous problems seemed to be exacerbated by lookups based on relations between sportiva and xoops.

i have no idea what exactly happens. But it really looks like that the server is dropping the connection somehow.
You say you can edit data in another tool. But can’t you edit data through servoy? After the error occurs of before. Are you saying that you never can edit data or only in that design → browse is the problem?

If it only happens in the switch but after and before that you can alter database data. Then you should try adding a validation query to that connection (see the server preferences)

jcompagner:
i have no idea what exactly happens. But it really looks like that the server is dropping the connection somehow.
You say you can edit data in another tool. But can’t you edit data through servoy? After the error occurs of before. Are you saying that you never can edit data or only in that design → browse is the problem?

If it only happens in the switch but after and before that you can alter database data. Then you should try adding a validation query to that connection (see the server preferences)

Update 15 Feb 2005
I’m having trouble again after the problem seemed to go away (added the validation query).

Now Servoy complains that it can’t retrieve data from the xoops_users table because there is no Primary Key, which is a load of hooey. Here’s a shot of that table via CocoaMySQL

and here’s a shot of the same table from the Servoy DataProvider window

The form I thought I was having trouble with contains a Tab Panel that displays data from the xoops_users table and so thought the problem was the relation between the host and tab panel. But if I try to open simple form attached to the xoops_users I get “Cannot work without primaryKey on table ‘xoops_users’”

But when I look at the images above it seems that Servoy is ignoring the finer definition of the fields - “uid” is designated as Integer, length undefined, rather than mediumint, length 8 and Primary key.

Also the ‘level’ field is marked in red but clicking on the Properties button is ignored so I have no idea what to fix. Update I found that “level” is a reserved word in Servoy so I guess I have to hack into xoops and change its usage everywhere - or can I alias it somehow so that Servoy is left happy?
BTW In my exerience with Servoy highlighting failures in red is as about as useful as a system beep without an explanation - none at all. Let me show you why. It would be much better if the system put up a dialog box when I try to OK the form. Maybe this is a blindspot for all but we servoy newbies.

And finally, changes to the table are rejected with this error message “could not update columninfo, column has none” but still the uid row shows my changes eg db identity under Sequence Type and they persist even after I cancel out of the window and return. It doesn’t survive restarting Servoy, which is as expected.

Looks a lot like problems I had.

Solved it by falling back to version 11 of the drivers.
problem had to do with the unsigned property of integer field. If memory serves I had to be checked

HTH

OK, maybe I need to be checked, but what I meant was IT (so the unsigned property) had to be checked