As with all problem reports, could you say what exact version of
Derby you are using.  There were 2 different 10.2 releases, the
latest was 10.2.2.0.

Also just to verify, do you expect your database to be read only?
There have been problems in the past with soft upgrade and stored
prepared statements - DERBY-541.



Stanley Bradbury wrote:
Andy Stewart wrote:

Hi can anyone help?

We were using derby 10.1 but have since upgraded to 10.2. Any databases created against version 10.1 work fine in our app against version 10.2. of derby. However when we try and connect to a database that has been created in 10.2 we get the following exception. Does anyone know why this is and what the solution is?

Cheers,
Andy

Caused by: java.sql.SQLException: Container was opened in read-only mode.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source) at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.prepareMetaDataStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.prepareSPS(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQueryUsingSystemTables(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.doGetCols(Unknown Source) at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getColumns(Unknown Source)

Hi Andy -
Derby will open a database as read-only when it can't create the db.lck file when the database is booted. Check for ownership and permission problems with the 10.2 database directories. Does this message show up in the derby.log file as well?



Reply via email to