db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Jodeleit (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-4160) getMetaData().getIndexInfo crashes with "ERROR X0Y68: Column 'PARAM1' already exists."
Date Mon, 11 Jun 2012 10:13:42 GMT

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

Peter Jodeleit commented on DERBY-4160:
---------------------------------------

Hi Dag,
there seems to be a relation to bug DERBY-2584. I checked the log files of the weekend and
the exception reported there seems similar [trace below].

I could give you an outline of our integration test. It should be easy to extract a dedicated
test from this, but i didn't tried yet (and i don't think i'll find time for this in the near
future).
What we do is:
1) create a databases
2) query the database meta data
[3) create some table 4) perform some CRUD operations]
5) Loop to step 1 for a few times

As in DERBY-2584 if transaction isolation is READ_COMMITTED everything works as expected (bug
did not show up for about 3 months with 10.8.2.2. or with 10.5.3.0 for more than two years,
both with alomst daily execution of the test suite).

This is the trace I got last friday:
ERROR X0Y68: Column 'PARAM1' already exists.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(Unknown
Source)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(Unknown Source)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSParams(Unknown Source)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateSPS(Unknown Source)
	at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.updateSYSSTATEMENTS(Unknown Source)
	at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(Unknown Source)
	at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(Unknown Source)
	at org.apache.derby.impl.sql.compile.ExecSPSNode.generate(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
	at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(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.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.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)
	at de.espirit.or.impl.generic.GenericTableSynchronizer.getColumns(GenericTableSynchronizer.java:306)
	at de.espirit.or.impl.generic.GenericTableSynchronizer.updateDB(GenericTableSynchronizer.java:120)
	at de.espirit.or.impl.generic.GenericSchemaSynchronizer.updateDB(GenericSchemaSynchronizer.java:145)
	at de.espirit.or.impl.schema.SchemaImpl.updateDBTables(SchemaImpl.java:409)
	at de.espirit.or.impl.AbstractSessionHandler.syncSchemaWithDB(AbstractSessionHandler.java:934)
	at de.espirit.or.impl.AbstractSessionHandler.syncSchemaWithDB(AbstractSessionHandler.java:77)
	at de.espirit.firstspirit.content.ContentManagerImpl$TemporalSessionHandler.syncSchemaWithDB(ContentManagerImpl.java:1310)

This is the trace I got this weekend. As you can see, the call to "DatabaseMetaData.getColumns(..)"
was successfull in this run. The only code change was an additional call to "DatabaseMetaData.getDatabaseProductName()"
for logging.
java.sql.SQLException: Java exception: '1: java.lang.ArrayIndexOutOfBoundsException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.javaException(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.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.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)
	at de.espirit.or.impl.generic.GenericTableSynchronizer.getColumns(GenericTableSynchronizer.java:313)
	... 27 more
Caused by: java.sql.SQLException: Java exception: '1: java.lang.ArrayIndexOutOfBoundsException'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
	... 47 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.derby.impl.sql.GenericParameterValueSet.initialize(Unknown Source)
	at org.apache.derby.impl.sql.execute.BaseActivation.setupActivation(Unknown Source)
	at org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(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.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver40.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)
	at de.espirit.or.impl.generic.GenericTableSynchronizer.getColumns(GenericTableSynchronizer.java:313)
	at de.espirit.or.impl.generic.GenericTableSynchronizer.updateDB(GenericTableSynchronizer.java:121)
	at de.espirit.or.impl.generic.GenericSchemaSynchronizer.updateDB(GenericSchemaSynchronizer.java:145)
	at de.espirit.or.impl.schema.SchemaImpl.updateDBTables(SchemaImpl.java:409)
	at de.espirit.or.impl.AbstractSessionHandler.syncSchemaWithDB(AbstractSessionHandler.java:934)
	at de.espirit.or.impl.AbstractSessionHandler.syncSchemaWithDB(AbstractSessionHandler.java:77)
	at de.espirit.firstspirit.content.ContentManagerImpl$TemporalSessionHandler.syncSchemaWithDB(ContentManagerImpl.java:1310)

I changed our code back to READ_COMMITTED now, perhaps I use the same workaround as in mentioned
in DERBY-2584 (using READ_COMMITTED for database meta data operations and SERIALIZABLE for
the rest).

                
> getMetaData().getIndexInfo crashes with "ERROR X0Y68: Column 'PARAM1' already exists."
> --------------------------------------------------------------------------------------
>
>                 Key: DERBY-4160
>                 URL: https://issues.apache.org/jira/browse/DERBY-4160
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.0
>         Environment: FreeBSD java 1.6.0, 64-Bit Server VM; DataNucleus JDO
>            Reporter: ArtemGr
>              Labels: derby_triage10_5_2
>
> The following code in DataNucleus:
> rs = conn.getMetaData().getIndexInfo(catalogName, schemaName, tableName, false,
> true);
> triggers an Exception (http://gist.github.com/95679):
> Caused by: java.sql.SQLException: Column 'PARAM1' already exists.
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
>         ... 105 more
> Caused by: ERROR X0Y68: Column 'PARAM1' already exists.
>         at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:303)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(DataDictionaryImpl.java:1678)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(DataDictionaryImpl.java:1662)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSParams(DataDictionaryImpl.java:3682)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateSPS(DataDictionaryImpl.java:3830)
>         at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.updateSYSSTATEMENTS(SPSDescriptor.java:1112)
>         at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(SPSDescriptor.java:736)
>         at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.getPreparedStatement(SPSDescriptor.java:642)
>         at org.apache.derby.impl.sql.compile.ExecSPSNode.generate(ExecSPSNode.java:177)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:447)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:794)
>         at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:128)
>         ... 99 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message