Issue Details (XML | Word | Printable)

Key: NUCRDBMS-357
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: Marco Schulze
Votes: 0
Watchers: 0
Operations

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

Generation of indexes on schema : MySQLSyntaxErrorException: Too many key parts specified

Created: 02/Apr/10 06:03 PM   Updated: 05/Apr/10 04:36 PM   Resolved: 03/Apr/10 10:43 AM
Component/s: Schema
Affects Version/s: 2.0.3, 2.1.0.m1
Fix Version/s: 2.0.4, 2.1.0.m2

Environment: MySQL 5.1.41

Forum Thread URL: http://www.jpox.org/servlet/forum/viewthread_thread,6042
Datastore: MySQL
Severity: Development


 Description  « Hide
When using two interface fields in a class and too many implementations of this interface exist, the following exception happens:

****
2010-04-02 16:38:29,109 ERROR [DataNucleus.Datastore] An exception was thrown while adding/validating class(es) : Too many key parts specified; max 16 parts allowed
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Too many key parts specified; max 16 parts allowed
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2477)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:741)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:587)
        at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:91)
        at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:730)
        at org.datanucleus.store.rdbms.table.TableImpl.createIndices(TableImpl.java:652)
        at org.datanucleus.store.rdbms.table.TableImpl.validateIndices(TableImpl.java:597)
        at org.datanucleus.store.rdbms.table.TableImpl.validateConstraints(TableImpl.java:394)
        at org.datanucleus.store.rdbms.table.ClassTable.validateConstraints(ClassTable.java:3271)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2759)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2489)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2134)
        at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:982)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:948)
        at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:914)
        at org.datanucleus.store.AbstractStoreManager.getExtent(AbstractStoreManager.java:1023)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.getExtent(RDBMSStoreManager.java:1318)
        at org.datanucleus.ObjectManagerImpl.getExtent(ObjectManagerImpl.java:4139)
        at org.datanucleus.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1486)
        at org.datanucleus.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1502)
        at org.datanucleus.jdo.connector.PersistenceManagerImpl.getExtent(PersistenceManagerImpl.java:558)
****

Additionally, DataNucleus seems not to clean up all foreign keys it created leading to multiple exceptions like this:

****
2010-04-02 16:38:29,111 ERROR [DataNucleus.Datastore] An exception was thrown while adding/validating class(es) : Duplicate key name 'jfiretrade_articlecontainerlink_fk5'
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate key name 'jfiretrade_articlecontainerlink_fk5'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
        at com.mysql.jdbc.Util.getInstance(Util.java:381)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2477)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:741)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:587)
        at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:91)
        at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:730)
        at org.datanucleus.store.rdbms.table.TableImpl.createForeignKeys(TableImpl.java:531)
        at org.datanucleus.store.rdbms.table.TableImpl.validateForeignKeys(TableImpl.java:475)
        at org.datanucleus.store.rdbms.table.TableImpl.validateConstraints(TableImpl.java:395)
        at org.datanucleus.store.rdbms.table.ClassTable.validateConstraints(ClassTable.java:3271)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2759)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2489)
        at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2134)
        at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:982)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:948)
        at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:914)
        at org.datanucleus.store.AbstractStoreManager.getExtent(AbstractStoreManager.java:1023)
        at org.datanucleus.store.rdbms.RDBMSStoreManager.getExtent(RDBMSStoreManager.java:1318)
        at org.datanucleus.ObjectManagerImpl.getExtent(ObjectManagerImpl.java:4139)
        at org.datanucleus.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1486)
        at org.datanucleus.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1502)
        at org.datanucleus.jdo.connector.PersistenceManagerImpl.getExtent(PersistenceManagerImpl.java:558)
****

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 03/Apr/10 10:43 AM
SVN trunk and branches/2.0 have this fixed, now creates indices for a reference field for each implementations FK cols and only when mapping interfaces using that mapping strategy

Marco Schulze added a comment - 05/Apr/10 04:36 PM
Thanks a lot for fixing! Seems to work fine in JFire, now.