H2 Embedded DB goes in read only mode on Windows Vista

357 views
Skip to first unread message

bhavin k

unread,
Oct 11, 2011, 8:39:10 AM10/11/11
to H2 Database
Dear Thomas,
We are trying to use H2 in embedded mode in a
small java application. The application works fine on Windows XP, but
the same application can't insert into database (says DB in read only
mode) when the java app runs on a Windows vista machine. We saw the
posting of bug 311 and used the latest build of DB 1.3.160, but the
problem is still persisting.

Below is the error we are getting.
org.h2.jdbc.JdbcSQLException: The database is read only; SQL
statement:
insert into Mytable (col1 ,col2)values(5,5) [90097-153]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:
327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.message.DbException.get(DbException.java:133)
at org.h2.engine.Database.checkWritingAllowed(Database.java:1616)
at org.h2.table.Table.checkWritingAllowed(Table.java:1042)
at org.h2.engine.User.hasRight(User.java:111)
at org.h2.engine.User.checkRight(User.java:97)
at org.h2.command.dml.Insert.insertRows(Insert.java:95)
at org.h2.command.dml.Insert.update(Insert.java:86)
at org.h2.command.CommandContainer.update(CommandContainer.java:69)
at org.h2.command.Command.executeUpdate(Command.java:212)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:
143)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:
129)

Can you please provide some insights on how to resolve it.
We are not getting the error on Vista if we run the database on some
other machine in server mode and app connects to it in client server
mode. Error comes only when DB is run in embedded mode only on Vista
machines.

Jeffrey Krzysztow

unread,
Oct 11, 2011, 10:43:37 AM10/11/11
to h2-da...@googlegroups.com
Vista (and Windows 7) will not let you modify data if it is in the "\Program Files" tree. In order words, if the database you are using is in the folder the program is normally installed and run from, it cannot modify the files do to tighter restrictions imposed on Vista and Windows 7 and Mac OS X Lion.

Jeffrey


--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


Thomas Mueller

unread,
Oct 19, 2011, 2:48:14 AM10/19/11
to h2-da...@googlegroups.com
Hi,

What database URL do you use?

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages