Reported by client. Check
https://na2.salesforce.com/50040000003Ghea
In client server mode, when we open client connection through switchToFile(sameFile) second time , the following Client Connection Error is displayed.
Client connection error
at com.db4o.internal.cs.ClientObjectContainer$1.retrieveMessage(Unknown Source)
at com.db4o.internal.cs.ClientObjectContainer$1.run(Unknown Source)
at com.db4o.foundation.Lock4.run(Unknown Source)
at com.db4o.internal.cs.ClientObjectContainer.getResponseMultiThreaded(Unknown Source)
at com.db4o.internal.cs.ClientObjectContainer.getResponse(Unknown Source)
at com.db4o.internal.cs.ClientObjectContainer.expectedResponse(Unknown Source)
at com.db4o.internal.cs.ClientObjectContainer.switchToFile(Unknown Source)
at Test.main(Test.java:27)
It works fine for 5.5. Attached the test case here.
Msg.SWITCH_TO_FILE failed.
com.db4o.DatabaseFileLockedException: /home/patrick/workspaces/db4o/test/formula2.yap
at com.db4o.internal.JDK_1_4.lockFile(JDK_1_4.java:35)
IIRC file locking has been fixed to explicitly take care of VM-internal (or better: classloader-internal, as far as Java is concerned) locks through a dedicated map in JDK_1_4#lockFile(). This seems to "fire back" here. Will check whether there's just some unlock call missing or whether there is a bigger, conceptual issue.