Java – how to change Derby to read / write mode

I have a derby database that gives me a read-only error The database worked normally until last week when there was insufficient disk 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 the disks and 80% of the disks were released as Derby But 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 a DB Lck file (file size 0), can I delete this file? Is there any other way to change its read / write mode? thank you!

Solution

The reason why I get the SQL error is the lock file owned by root I am here. Find it in the artifactory / Derby directory, which is called dB Lck, delete it, get the artifact and start it again

We run artifactory under tomcat, and The artifactory directory is in the home directory of the user who started Tomcat

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>