Issue Details (XML | Word | Printable)

Key: NUCRDBMS-490
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: yuri
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Exception thrown while querying indices for table

Created: 17/Jan/11 06:16 PM   Updated: 01/Feb/11 08:36 PM   Resolved: 23/Jan/11 11:50 AM
Component/s: Schema
Affects Version/s: 2.2.2
Fix Version/s: None

File Attachments: 1. Zip Archive JPATest4.zip (3 kB)

Environment: Ubuntu 10.04 64 bit

Datastore: PostgreSQL
Severity: Development


 Description  « Hide
The DDL workaround mentioned in http://www.datanucleus.org/servlet/jira/browse/NUCRDBMS-489 only works when creating the schema. When querying the data, the following error occurs:

Exception thrown while querying indices for table=C

(the stack trace is at the end)

Repro steps:

Run the SchemaTool for the attached project in DDL mode
Edit the generated DDL to remove the index prefix from the CREATE INDEX statement
Run the DDL using a database tool (e.g. psql)
Run the attached test.

Exception when querying the data:


javax.persistence.RollbackException: Transaction failed to commit
at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:120)
at org.datanucleus.test.Main.execute(Main.java:60)
at org.datanucleus.test.Main.main(Main.java:26)
Caused by: javax.persistence.PersistenceException: Exception thrown while querying indices for table=B
at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:244)
at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:118)
... 2 more
Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:239)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getIndexInfo(AbstractJdbc2DatabaseMetaData.java:3934)
at org.apache.commons.dbcp.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:327)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getRDBMSTableIndexInfoForTable(RDBMSSchemaHandler.java:616)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getRDBMSTableIndexInfoForTable(RDBMSSchemaHandler.java:585)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getSchemaData(RDBMSSchemaHandler.java:202)
at org.datanucleus.store.rdbms.table.TableImpl.getExistingCandidateKeys(TableImpl.java:1099)
at org.datanucleus.store.rdbms.table.TableImpl.validateCandidateKeys(TableImpl.java:698)
at org.datanucleus.store.rdbms.table.TableImpl.validateConstraints(TableImpl.java:400)
at org.datanucleus.store.rdbms.table.ClassTable.validateConstraints(ClassTable.java:3338)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2700)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2429)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2074)
at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:860)
at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:909)
at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:442)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:114)
at org.datanucleus.jdo.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3404)
at org.datanucleus.jdo.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4778)
at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:3179)
at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:3119)
at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:3260)
at org.datanucleus.ObjectManagerImpl$2.transactionPreCommit(ObjectManagerImpl.java:324)
at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:394)
at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:279)
at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:106)
... 2 more
javax.persistence.PersistenceException: Exception thrown while querying indices for table=C
at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:244)
at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:187)
at org.datanucleus.test.Main$2.run(Main.java:44)
at org.datanucleus.test.Main.execute(Main.java:59)
at org.datanucleus.test.Main.main(Main.java:38)
Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:340)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:239)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getIndexInfo(AbstractJdbc2DatabaseMetaData.java:3934)
at org.apache.commons.dbcp.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:327)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getRDBMSTableIndexInfoForTable(RDBMSSchemaHandler.java:616)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getRDBMSTableIndexInfoForTable(RDBMSSchemaHandler.java:585)
at org.datanucleus.store.rdbms.schema.RDBMSSchemaHandler.getSchemaData(RDBMSSchemaHandler.java:202)
at org.datanucleus.store.rdbms.table.TableImpl.getExistingIndices(TableImpl.java:1157)
at org.datanucleus.store.rdbms.table.TableImpl.validateIndices(TableImpl.java:576)
at org.datanucleus.store.rdbms.table.TableImpl.validateConstraints(TableImpl.java:402)
at org.datanucleus.store.rdbms.table.ClassTable.validateConstraints(ClassTable.java:3338)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2700)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2429)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2074)
at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:860)
at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:909)
at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:442)
at org.datanucleus.store.rdbms.query.RDBMSQueryUtils.getStatementForCandidates(RDBMSQueryUtils.java:404)
at org.datanucleus.store.rdbms.query.JPQLQuery.compileQueryFull(JPQLQuery.java:777)
at org.datanucleus.store.rdbms.query.JPQLQuery.compileInternal(JPQLQuery.java:268)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1664)
at org.datanucleus.store.query.Query.executeWithMap(Query.java:1555)
at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:171)
... 3 more


Sort Order: Ascending order - Click to sort in descending order
yuri added a comment - 19/Jan/11 02:16 AM
Andy,

Please feel free to close or decrease priority of this and related http://www.datanucleus.org/servlet/jira/browse/NUCRDBMS-489 issues if there is no interest from other users, we are no longer blocked.

Thanks,
Yuri

Andy Jefferson added a comment - 23/Jan/11 11:50 AM
Don't see any issue