After some problems following a crash and some attempts to fix them, I have 
now
a database which 
1) works fine if I open it read/write (in embedded mode), initialize it 
using
  ";MV_STORE=FALSE"  appended to the URL and running 
  SET DATABASE TRANSACTION CONTROL MVCC
  SET FILES LOG FALSE
  SET FILES NIO SIZE 4096
  SET AUTOCOMMIT FALSE
  SET CACHE_SIZE 1048576
  then processing, then commiting and shutting down
2) throws an exception with error message  "The database is read only 
[90097-193]"
  (see stack trace at the bottom of the email)
  during establishing the connection when I try to open it read only using 
  ";MV_STORE=FALSE;ACCESS_MODE_DATA=r;FILE_LOCK=no" appended to the URL

However, before the crash happened, that database could be used in 
read-only mode without any 
problem. 

What I do not understand at all is why the DB works fine when opening, 
using and storing 
in read/write mode and why it wants it to be writable when I open it 
read-only? If there would be 
any scheduled operations for fixing data, surely that should have happened 
already during the
latest shutdown? 

Is there any way to fix the database so that it can be used in read-only 
mode again apart from
exporting all data and importing into a new database (which I want to avoid 
because the 
database is rather big). 

If there is no way to fix the database in place, what is the fastest and 
most efficient way to 
export and import data or to backup and re-create the database?

How can I make sure that this problem will not occur again in the future?

----
Stack trace:
Exception in thread "main" org.h2.jdbc.JdbcSQLException: The database is 
read only [90097-193]
        at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:179)
        at org.h2.message.DbException.get(DbException.java:155)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.engine.Database.checkWritingAllowed(Database.java:1927)
        at org.h2.store.PageStore.logUndo(PageStore.java:1061)
        at org.h2.store.PageFreeList.allocate(PageFreeList.java:138)
        at org.h2.store.PageStore.allocatePage(PageStore.java:1147)
        at 
org.h2.store.PageInputStream.allocateAllPages(PageInputStream.java:144)
        at org.h2.store.PageLog.recover(PageLog.java:266)
        at org.h2.store.PageStore.recover(PageStore.java:1403)
        at org.h2.store.PageStore.openExisting(PageStore.java:367)
        at org.h2.store.PageStore.open(PageStore.java:288)
        at org.h2.engine.Database.getPageStore(Database.java:2482)
        at org.h2.engine.Database.open(Database.java:695)
        at org.h2.engine.Database.openDatabase(Database.java:273)
        at org.h2.engine.Database.<init>(Database.java:267)
        at org.h2.engine.Engine.openSession(Engine.java:64)
        at org.h2.engine.Engine.openSession(Engine.java:176)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:154)
        at org.h2.engine.Engine.createSession(Engine.java:137)
        at org.h2.engine.Engine.createSession(Engine.java:27)
        at 
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:349)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:115)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:99)
        at org.h2.Driver.connect(Driver.java:69)
        at java.sql.DriverManager.getConnection(DriverManager.java:664)
        at java.sql.DriverManager.getConnection(DriverManager.java:247)




-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to