db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-2354) Unable to perform select query using DISTINCT on a read-only database
Date Mon, 11 Apr 2011 08:37:05 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018240#comment-13018240
] 

Knut Anders Hatlen commented on DERBY-2354:
-------------------------------------------

Note that the error message changed in Derby 10.3. In 10.2 the following error was raised
(same as in the original report):

ij version 10.2
ij> connect 'jdbc:derby:jar:(testdb.zip)db';
ij> select distinct id from t;
ERROR 40XD1: Container was opened in read-only mode.

Derby 10.3 and later instead fails like this:

ij version 10.9
ij> connect 'jdbc:derby:jar:(testdb.zip)db';
ij> select distinct id from t;
ERROR XSAI3: Feature not implemented.

Stack trace from the latest development sources:

ERROR XSAI3: Feature not implemented.
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
	at org.apache.derby.impl.store.raw.log.ReadOnly.checkVersion(ReadOnly.java:458)
	at org.apache.derby.impl.store.raw.RawStore.checkVersion(RawStore.java:2255)
	at org.apache.derby.impl.store.access.RAMTransaction.checkVersion(RAMTransaction.java:2166)
	at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.createConglomerate(HeapConglomerateFactory.java:175)
	at org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(RAMTransaction.java:823)
	at org.apache.derby.iapi.store.access.DiskHashtable.<init>(DiskHashtable.java:123)
	at org.apache.derby.iapi.store.access.BackingStoreHashtable.spillToDisk(BackingStoreHashtable.java:483)
	at org.apache.derby.iapi.store.access.BackingStoreHashtable.add_row_to_hash_table(BackingStoreHashtable.java:400)
	at org.apache.derby.iapi.store.access.BackingStoreHashtable.putRow(BackingStoreHashtable.java:728)
	at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:803)
	at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchSet(GenericScanController.java:1268)
	at org.apache.derby.impl.store.access.BackingStoreHashTableFromScan.<init>(BackingStoreHashTableFromScan.java:117)
	at org.apache.derby.impl.store.access.RAMTransaction.createBackingStoreHashtableFromScan(RAMTransaction.java:1355)
	at org.apache.derby.impl.sql.execute.HashScanResultSet.openCore(HashScanResultSet.java:262)
	at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(BasicNoPutResultSetImpl.java:255)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:630)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:559)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:521)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:363)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)
	at org.apache.derby.iapi.tools.run.main(run.java:53)

(The message changed after DERBY-2537.)

> Unable to perform select query using DISTINCT on a read-only database
> ---------------------------------------------------------------------
>
>                 Key: DERBY-2354
>                 URL: https://issues.apache.org/jira/browse/DERBY-2354
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: Reproduced in WinXP professional, Linux (Ubuntu 6.10) with Sun Java
5.0
>            Reporter: Thomas Kelder
>              Labels: derby_triage10_5_2
>         Attachments: DerbyTest.java, d2354-createdb.sql, d2354-repro.sql
>
>
> It is not possible to perform queries using DISTINCT on a read-only database packaged
in a zip file. This generates the following error:
> ERROR 40XD1: Container was opened in read-only mode.   
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.BaseContainer.use(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source)
> 	at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source)
> 	at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.addContainer(Unknown Source)
> 	at org.apache.derby.impl.store.raw.xact.Xact.addContainer(Unknown Source)
> 	at org.apache.derby.impl.store.access.heap.Heap.create(Unknown Source)
> 	at org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.createConglomerate(Unknown
Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(Unknown Source)
> 	at org.apache.derby.iapi.store.access.DiskHashtable.<init>(Unknown Source)
> 	at org.apache.derby.iapi.store.access.BackingStoreHashtable.spillToDisk(Unknown Source)
> 	at org.apache.derby.iapi.store.access.BackingStoreHashtable.add_row_to_hash_table(Unknown
Source)
> 	at org.apache.derby.iapi.store.access.BackingStoreHashtable.put(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.fetchSet(Unknown Source)
> 	at org.apache.derby.impl.store.access.BackingStoreHashTableFromScan.<init>(Unknown
Source)
> 	at org.apache.derby.impl.store.access.RAMTransaction.createBackingStoreHashtableFromScan(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.HashScanResultSet.openCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
> 	at DerbyTest.main(DerbyTest.java:29)
> The problem can be reproduced using the attached java program and the following database
file:
> http://ftp2.bigcat.unimaas.nl/~thomas.kelder/derbytest/testdb.zip.
> Both the 'derby.storage.tempDirectory' and 'derby.stream.error.file' properties are set
to writable locations, as advised in the help file.
> Also see derby-user mailing list thread: http://article.gmane.org/gmane.comp.apache.db.derby.user/6123
> "This appears to be a bug, possibly a regression.  When I converted your
> DB to10.0 everything worked fine even when I did NOT set the properties
> for tempDirectory and error.file (hmmm..).  When I switched to using the
> 10.1  or 10.2 jars and accessed the very same database the 40XD1 ERROR
> happened." (Stanley Bradbury)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message