I have a Derby database that is giving me a read-only error. The database was working fine, up until last week when disk ran out of space:
Caused by: java.io.IOException: No space left on device
at java.io.RandomAccessFile.writeBytes0(Native Method)
at java.io.RandomAccessFile.writeBytes(RandomAccessFile.java:520)
at java.io.RandomAccessFile.write(RandomAccessFile.java:550)
at org.apache.derby.impl.store.raw.log.LogAccessFile.writeToLog(Unknown Source)
at org.apache.derby.impl.store.raw.log.LogAccessFile.flushDirtyBuffers(Unknown Source)
... 23 more
I cleaned up disk and there are 80% of disk is freed for derby. But the derby is still in read-only mode:
java.sql.SQLException: An SQL data change is not permitted for a read-only connection, user or database.
org.apache.derby.impl.jdbc.EmbedSQLException: An SQL data change is not permitted for a read-only connection, user or database.
org.apache.derby.iapi.error.StandardException: An SQL data change is not permitted for a read-only connection, user or database.
I found there is a db.lck file (which file size is 0) there, can I remove that file? Is there any other way to change it read/write mode? Thank you!
I cleaned up disk but I didn't reboot my java process which connected to derby. I killed the process and restarted it, derby is in read/write mode.