5 messages in com.mysql.lists.javaError:While trying to read and write ...| From | Sent On | Attachments |
|---|---|---|
| Lars Dittmann | 21 Jan 2000 04:21 | |
| sin...@mysql.com | 21 Jan 2000 04:43 | |
| Lars Dittmann | 21 Jan 2000 05:12 | |
| sin...@mysql.com | 21 Jan 2000 05:29 | |
| webmaster junet | 22 Jan 2000 06:11 |
| Subject: | Error:While trying to read and write into one table at the same time![]() |
|---|---|
| From: | Lars Dittmann (ldit...@darmstadt.gmd.de) |
| Date: | 01/21/2000 04:21:07 AM |
| List: | com.mysql.lists.java |
Hi everybody,
We are using the following components: MySQL v 3.21.29-gamma and mm.mysql.jdbc-1.2a (or maybe mm.mysql.jdbc-1.2b)
Two days ago we have encountered a problem with our Java Clients, who write and read in our database at the same time. Once in a while this error code occurred: SQLException: Error during query: Unexpected Exception: java.sql.SQLException message given: General error: Can't lock file (errno: 11) SQLState: S1000 VendorError: 0
We could not explain the problem exactly, but now we have isolated it by the following test:
We have created to Java Clients: Test_read: Reads permanently from table1 Test_write: Writes permanently new records into table1
We ran the clients simultaneously in different combinations: Running two or more Test_read Clients at the same was no problem Running two or more Test_write Clients at the same was no problem Running one Test_read and one Test_write Client at the same time was no problem for the Test_read Client, but the Test_write throuw the exception mentioned above.
In Test_read we are using ReadOnly-Connections, that did not solve the problem.
Question: How can we solve the problem? Restriction: We need to access the database without coordination, so writing a Scheduler won't help Idea: For all Insert-Statements we could write a function, that checks, if the returned error is 11. If this is the case the functions waits like 5 sec. and tries to Insert again. But we do not think this is very nice.
Thanks for you help, Andre & Lars




