Dear All,
I am facing problem when insort in to database. Please Provide me some solution.
My flow of prokect is: I am sending queryresponse to xml server and retrive the queryresponse and populate the database.
When I run my application it showing error like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00:31:19,105 DEBUG BasicResourcePool:1159 - trace com.mchange.v2.resourcepool.BasicResourcePool@60a77c [managed: 5, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1125fac)
00:31:19,105 DEBUG JDBCTransaction:59 - current autocommit status: false
00:31:19,105 DEBUG JDBCTransaction:103 - commit
00:31:19,105 DEBUG SQL:346 - [b]insert into hardware_system_configuration.filesystems (filesystem_name, storage_pools, storage_system_id, volume_id, contains_slices, internal_use, filesystem_type, cworm_state, celerra_system_record_id, filesystem_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[/b]
Hibernate: [b]insert into hardware_system_configuration.filesystems (filesystem_name, storage_pools, storage_system_id, volume_id, contains_slices, internal_use, filesystem_type, cworm_state, celerra_system_record_id, filesystem_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[/b]
00:31:19,105 DEBUG GooGooStatementCache:381 - cxnStmtMgr.statementSet( com.mysql.jdbc.Connection@b5df86 ).size(): 3
00:31:19,105 DEBUG GooGooStatementCache:117 - checkoutStatement: com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 10; checked out: 1; num connections: 5; num keys: 10
00:31:19,121 DEBUG NewPooledConnection:304 - com.mchange.v2.c3p0.impl.NewPooledConnection@a826f5 handling a throwable.
[b]java.sql.BatchUpdateException: Duplicate entry '140-4883' for key 1[/b]
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.emc.nas.dvt.xml.api.database.FilesystemsTable.addRowToTable(FilesystemsTable.java:110)
at com.emc.nas.dvt.xml.api.collect.CollectCelerraConfigurationInformation.populateDBFromQueryResponse(CollectCelerraConfigurationInformation.java:247)
at com.emc.nas.dvt.xml.api.execute.ConfigurationCapture.main(ConfigurationCapture.java:228)
00:31:19,121 DEBUG SqlUtils:83 - Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: 23000; errorCode: 1062]
java.sql.BatchUpdateException: Duplicate entry '140-4883' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.emc.nas.dvt.xml.api.database.FilesystemsTable.addRowToTable(FilesystemsTable.java:110)
at com.emc.nas.dvt.xml.api.collect.CollectCelerraConfigurationInformation.populateDBFromQueryResponse(CollectCelerraConfigurationInformation.java:247)
at com.emc.nas.dvt.xml.api.execute.ConfigurationCapture.main(ConfigurationCapture.java:228)
00:31:19,121 DEBUG DefaultConnectionTester:67 - Testing a Connection in response to an Exception:
java.sql.BatchUpdateException: Duplicate entry '140-4883' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.emc.nas.dvt.xml.api.database.FilesystemsTable.addRowToTable(FilesystemsTable.java:110)
at com.emc.nas.dvt.xml.api.collect.CollectCelerraConfigurationInformation.populateDBFromQueryResponse(CollectCelerraConfigurationInformation.java:247)
at com.emc.nas.dvt.xml.api.execute.ConfigurationCapture.main(ConfigurationCapture.java:228)
00:31:19,136 DEBUG GooGooStatementCache:171 - checkinStatement(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 10; checked out: 0; num connections: 5; num keys: 10
00:31:19,136 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
00:31:19,136 ERROR JDBCExceptionReporter:72 - Duplicate entry '140-4883' for key 1
00:31:19,136 ERROR AbstractFlushingEventListener:300 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.emc.nas.dvt.xml.api.database.FilesystemsTable.addRowToTable(FilesystemsTable.java:110)
at com.emc.nas.dvt.xml.api.collect.CollectCelerraConfigurationInformation.populateDBFromQueryResponse(CollectCelerraConfigurationInformation.java:247)
at com.emc.nas.dvt.xml.api.execute.ConfigurationCapture.main(ConfigurationCapture.java:228)
Caused by: java.sql.BatchUpdateException: Duplicate entry '140-4883' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
... 10 more
Exception in thread "main" org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at com.emc.nas.dvt.xml.api.database.FilesystemsTable.addRowToTable(FilesystemsTable.java:110)
at com.emc.nas.dvt.xml.api.collect.CollectCelerraConfigurationInformation.populateDBFromQueryResponse(CollectCelerraConfigurationInformation.java:247)
at com.emc.nas.dvt.xml.api.execute.ConfigurationCapture.main(ConfigurationCapture.java:228)
Caused by: java.sql.BatchUpdateException: Duplicate entry '140-4883' for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
... 10 more
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Could you please any one give me some solution.
Thanks,
Manas[/b]
|