You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Bocete <ko...@gmail.com> on 2008/12/11 16:14:31 UTC

ResultSet.next() throws ERROR XSAI3: Feature not implemented.

Hi,

What I'm trying to do is to access a database inside a JAR archive in order
to copy some data from it to the primary, embedded database.

Here's what I did:
The database inside the jar file has been adjusted to be read-only:
"CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(" +
                "'derby.storage.tempDirectory', " +
                "'c:/Windows/Temp')"
"CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(" +
                "'derby.stream.error.file', " +
                "'c:/Windows/Temp/derby.log')"
The log directory has been deleted prior to archiving. The embedded
(primary) database has been booted properly, and has no problem working.

I boot the database inside the JAR successfully, create a statement using
ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.CONCUR_READ_ONLY, and create
a resultSet object using the simplest query "SELECT <columns> FROM <table>".

The resultSet is created, and I start reading rows using the exact same
method that works in the embedded database: while (resultSet .next())
{doSomething();}. The application reads data from the resultSet succesfully,
until a point (row 117/~730) where the resultSet .next() throws the
exception. The rs.last() method throws the exact same stack trace. Nothing
unusual with that (or any other row) in that table before archiving.

The stack trace contants several methods that seem related to temporary
files. Could it be that the JAR database is not infact entirely set to be
read-only?

Thanks,
Ivan


Here is the stack trace:

.... // Exception wrapper, unimportant

Caused by: java.sql.SQLException: Feature not implemented.
        at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.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.EmbedResultSet.closeOnTransactionError(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(Unknown
Source)
        at org.apache.derby.impl.jdbc.EmbedResultSet.next(Unknown Source)
        at org.una.db.Database.getRowTableFromResultSet(Database.java:181)
// <- that is the while (resultSet.next()) line
        ... 31 more
Caused by: java.sql.SQLException: Feature not implemented.
        at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
        at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
        ... 41 more
Caused by: ERROR XSAI3: Feature not implemented.
        at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.store.raw.log.ReadOnly.checkVersion(Unknown
Source)
        at org.apache.derby.impl.store.raw.RawStore.checkVersion(Unknown
Source)
        at
org.apache.derby.impl.store.access.RAMTransaction.checkVersion(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.putRow(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.addRowToHashTable(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowFromSource(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet.getNextRowCore(Unknown
Source)
        at
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(Unknown
Source)
        ... 34 more

-- 
View this message in context: http://www.nabble.com/ResultSet.next%28%29-throws-ERROR-XSAI3%3A-Feature-not-implemented.-tp20957328p20957328.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: ResultSet.next() throws ERROR XSAI3: Feature not implemented.

Posted by Bocete <ko...@gmail.com>.
Thanks, I've made some progress. I used the FORWARD_ONLY ResultSet, and I've
easily read through the entire table.

If that didn't work, I guess I'd have to un-jar the database to a temporary
directory, do what I need to do, and delete it afterwards. Just an idea for
anyone who runs into the same problem.

Thanks again.
Ivan
-- 
View this message in context: http://www.nabble.com/ResultSet.next%28%29-throws-ERROR-XSAI3%3A-Feature-not-implemented.-tp20957328p20981032.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: ResultSet.next() throws ERROR XSAI3: Feature not implemented.

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Bryan Pendleton <bp...@amberpoint.com> writes:

>> org.apache.derby.iapi.store.access.BackingStoreHashtable.spillToDisk(Unknown
>
> This sounds like DERBY-2354:
> https://issues.apache.org/jira/browse/DERBY-2354
>
> Unfortunately, there's not a fix for that problem yet.
>
> You can possibly avoid this problem by changing the memory parameters
> so that the backing store hash table does not try to spill to disk,
> but depending on the size of your database and the amount of memory
> you can give to Derby, that may or may not be successful.

I think that is worth a try. For instance to give the Java process 512MB
of memory, start your application with

  java -Xmx512M -Xms512M MyApplication

The -Xms (initial heap size) part is just as important as -Xmx (maximum
heap size), since BackingStoreHashTable spills to disk if it takes more
than 1% of the space left on the heap, if I remember correctly.

If you don't need a scrollable ResultSet, you could also work around the
problem by using ResultSet.TYPE_FORWARD_ONLY.

-- 
Knut Anders

Re: ResultSet.next() throws ERROR XSAI3: Feature not implemented.

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> org.apache.derby.iapi.store.access.BackingStoreHashtable.spillToDisk(Unknown

This sounds like DERBY-2354:
https://issues.apache.org/jira/browse/DERBY-2354

Unfortunately, there's not a fix for that problem yet.

You can possibly avoid this problem by changing the memory parameters
so that the backing store hash table does not try to spill to disk,
but depending on the size of your database and the amount of memory
you can give to Derby, that may or may not be successful.

thanks,

bryan