db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: "ERROR 40XD1: Container was opened in read-only mode" when performing SELECT DISTINCT on database in jar
Date Fri, 16 Feb 2007 15:21:31 GMT
Thomas Kelder wrote:
> Hello,
>
> I'm using Derby in embedded mode, with my databases stored in jar
> files. I've set the 'derby.storage.tempDirectory' and
> 'derby.stream.error.file' properties to writable locations, as advised
> in the help file.
>
> When I now perform a query like "SELECT DISTINCT FROM ..." on this
> database, it produces the following exception:
>
> ERROR 40XD1: Container was opened in read-only mode.
>
> Whether this exception occurs seems to depend on the number of rows in
> the database (e.g. on a small database with ~700 rows everything
> worked fine, but on a database with the same schema and about 3000
> rows, the exception occured).
>
> I've reproduced it in a testcase:
> http://ftp2.bigcat.unimaas.nl/~thomas.kelder/derbytest/DerbyTest.java
> Using the following database file:
> http://ftp2.bigcat.unimaas.nl/~thomas.kelder/derbytest/testdb.zip
>
> Does anyone have an idea about what causes this error?
> Thanks in advance.
>
> Thomas
>
Hi -

I took a quick look at the program:
  Set the property before you load the driver and I think your program 
will work fine.
tempDirectory is a static property that needs to be set before Derby is 
started.



Mime
View raw message