How to change derby to READ / WRITE mode
I have a Derby database that is giving me a read-only error. The database worked fine until the last week when the disk ran out of free 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 cleared the disc and 80% of the disc is free for the 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 that there is a db.lck file (file size 0), is it possible to delete this file? Is there any other way to change the read / write mode? Thank!
source to share
The reason I got the SQL error has to do with the lock file owned by root. I found it in the directory .artifactory/derby
, it db.lck
got called and removing it got artifactory working to run it again.
We are running artifactory under Tomcat and the .artifactory directory is in the home directory of the user who started Tomcat.
source to share