User e05b1833aa
11-03-2010 13:07:59
Hi,
I trying to import data from a tab-delimited text fileinto a table (IJC 5.3.1, mysql-5.0.77-4.el5_4.2) but this fails, I get the following errors (I removed some repetetive lines):
COMPOUND_VIALS_ID is mapped to current field COMPOUND_VIALS_ID
Vial ID is mapped to current field Vial ID
Row is mapped to current field Row
Column is mapped to current field Column
Rack ID is mapped to current field Rack ID
Starting to import data...
Warning: Failed to import row 1: PreparedStatementCallback; SQL [INSERT INTO COMPOUND_RACKS (Vial_ID,Rack_Row,Rack_ID,Rack_Column,COMPOUND_VIALS_ID) VALUES (?,?,?,?,?)]; Duplicate entry '0' for key 1; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 1
Warning: Failed to import row 2: PreparedStatementCallback; SQL [INSERT INTO COMPOUND_RACKS (Vial_ID,Rack_Row,Rack_ID,Rack_Column,COMPOUND_VIALS_ID) VALUES (?,?,?,?,?)]; Duplicate entry '0' for key 1; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 1
.
.
.
Warning: Failed to import row 25: PreparedStatementCallback; SQL [INSERT INTO COMPOUND_RACKS (Vial_ID,Rack_Row,Rack_ID,Rack_Column,COMPOUND_VIALS_ID) VALUES (?,?,?,?,?)]; Duplicate entry '0' for key 1; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 1
Error:
TOO MANY CONSECUTIVE ERRORS, TERMINATING IMPORT
Import completed in 0s.
0 entries successfully imported.
25 Errors.
Bad records can be found at
/mnt/disk1/evehom/Racks.txt.2._errors
Nothing gets imported. If i instead try to add one row to the table manually, and fill in some values, I get:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 1
at sun.reflect.GeneratedConstructorAccessor129.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
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:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2086)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2371)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2289)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2274)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:798)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
Caused: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO COMPOUND_RACKS (Rack_Column,Rack_ID,Rack_Row,COMPOUND_VIALS_ID,Vial_ID) VALUES (?,?,?,?,?)]; Duplicate entry '0' for key 1; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:792)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:815)
at com.im.df.impl.db.dao.PKAfterInsertDao.insertUsingAutoincrement(PKAfterInsertDao.java:68)
at com.im.df.impl.db.dao.PKAfterInsertDao$AutoincrementDMLImpl.insert(PKAfterInsertDao.java:131)
at com.im.df.impl.db.dao.DFDaoSupport.insert(DFDaoSupport.java:116)
at com.im.df.impl.db.dao.DFDaoWrapper.insert(DFDaoWrapper.java:65)
at com.im.df.impl.db.DBEntityDataProviderImpl.doInsertRow(DBEntityDataProviderImpl.java:357)
at com.im.df.impl.db.DBEntityDataProviderImpl.access$5(DBEntityDataProviderImpl.java:297)
at com.im.df.impl.db.DBEntityDataProviderImpl$3.doInTransaction(DBEntityDataProviderImpl.java:288)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at com.im.df.impl.db.DBEntityDataProviderImpl.insertOrFindRow(DBEntityDataProviderImpl.java:284)
at com.im.df.impl.db.InsertionHandler.doInsertData(InsertionHandler.java:307)
at com.im.df.impl.db.InsertionHandler.doInTransaction(InsertionHandler.java:267)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at com.im.df.impl.db.DBSchemaDataProviderImpl.insert(DBSchemaDataProviderImpl.java:187)
at com.im.ijc.core.api.actions.InsertRowAction$3.phase1InRequestProcessor(InsertRowAction.java:419)
at com.im.commons.progress.BackgroundRunner.processTheTask(BackgroundRunner.java:126)
at com.im.commons.progress.BackgroundRunner$1.run(BackgroundRunner.java:90)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:577)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1030)
Upon disconnecting and reconnecting, this row has been added indeed, but gets an ID of 0 (zero) in the table, and I cannot add additional rows manually.
Kind regards,
Evert