Apache OpenOffice (AOO) Bugzilla – Issue 41239
OOo defeated by dropped JDBC connection
Last modified: 2014-02-23 18:51:13 UTC
I wish to use OOo with an external MySQL database. Setting up the connection is fine. I start to create a form with the Form Wizard, all this works too. I finish the Wizard with the data entry option. The fields duely appear and I start to enter data. I press "Save" and I get the message: "Error inserting the new record No operations allowed after connection closed" If I try to do anything further with the data base I get a dialog with: SQL Status: 08S01 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:1895) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2342) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2838) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1584) at com.mysql.jdbc.Connection.serverPrepare(Connection.java:4932) at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1312) ** END NESTED EXCEPTION ** In fact all I have to do is wait a while before hitting 'Save' and this will happen. The assertion I presume is because the connection has died and OOo is trying to talk over it. Would it be possible to trap this exception and reconnect or do periodic keep alive type transactions ? The time period would either have to be frequent or used adjustable.
Having examined the Java code in the MySQL JDBC driver it appears that it is not part of its contract to manage the sessions. This means that it is up to the user application to do the Session management. If the connection has gone down OOo should probably try to re-establish the connection a few times before bubbling the exception up to the UI level.
I have the same problem: Remote MySQL database (v 4.0.22-standard) connected via MySQL/JDBC (using latest version v3.1.7) component in Base Problem exhibited in both 1.9.79 and 1.9.84 MySQL server is on a shared linux host OOo is installed on WinXP pro sp2 If I wait for very long the error occurs. I've tried enabling the connection pooling, and the connection seems to 'keep alive' for the duration of the pool, but after that time, I get the error mentioned by osavill when I try to save any changes. When querying for active users in the database (via the MySQL administrator app) I can see a connection from the user I'm using to connect to the database from within Base. The user has a status of "sleep", with how long the user has been in that status. Because of this I think that the connection is still around. Maybe OOo is 'forgetting' the connection? Does it ignore the connection once it has left the 'pool'? If we start connecting several times, we will be leaving a host of open connections that will either just sit there or be terminated by MySQL after whatever duration the database has set for sleeping connections.
not sure what I did, but now it seems that [whatever component is at fault] is properly disconnecting now, and it really is that that component is disconnecting and not just forgetting about the connection. I got 8 minutes of work before receiving the error message with pooling set to 600 seconds. Next I'm going to try going to an outrageously high number for pooling and see if that does anything.
Alas, 600 is max for pooling. So now I'm decreasing it to 30 (the lowest) to see if that aversly affects it. Creating tables as quickly as possible. 600s - 8:10 30s - 1:52 30s - 5:45 - Not very accurate I didn't realize descriptions were not stored in database *hits head on wall* This needs something more 'scientific' so I'll stop posting my numbers. What I've done is open the odb file I'm working on click on tables, input password and start watch while clicking ok. Work as normal until the error shows up. Without fail the error shows up every time I'm working in Base w/ MySQL (don't know about any other db) after a short period of time, some times longer than others, but not by much. Once I get the error I restart Base, and repeat.
Has there been any further input for this problem report ? Thanks,
seems to be solid report, set to NEW, Marc, please be so kind to retarget as needed, thank you, Max, Volunteer
Hi, if you add "?autoReconnect=true" behind your mysql database name, then problem should be solved. With this option the jdbc driver reconnect when necessary. I set this issue to WORKSFORME. Bye Marc
*** Issue 43939 has been marked as a duplicate of this issue. ***
seems that my last comment helps, so I close this issue now.
Is Marc's suggestion documented anywhere in the online help ? The reason I ask is that I have come across exactly the same problem in 2.0.3rc5, where the connection keeps timing out. This is with the latest jdbc connector from MySQL. The dropping of connections causes periodic catastophic failure in some of the wizards that don't seem to be able to handle such events properly, and just crash. I have come across this in testing on MacOSX with access to a distant mysql database. Alex
Hi dear, I know that issue was closed a long time ago. I can reproduce that and provide you guys a database connection for testing. Please take a look in my workaround for that error https://forum.openoffice.org/en/forum/viewtopic.php?f=40&t=40101&p=302444#p184382 If my comments proceed, may be you just should add a checkbox "enable auto reconnect" checkbox in the database properties connection dialog. Hope it helps. Kind regards, me.