- This topic has 5 replies, 5 voices, and was last updated 13 years, 10 months ago by dakshinn.
-
AuthorPosts
-
CFaisalMemberHi ALL,
I run the Qtuickstart Hibernate Introduction tutorial successfully. But when i tried to run again, it started giving this error below.
Please help how to resolve this issue.
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
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.myeclipse.hibernate.HibernateExample.addUser(HibernateExample.java:41)
at com.myeclipse.hibernate.HibernateExample.main(HibernateExample.java:12)
Caused by: java.sql.BatchUpdateException: Duplicate entry ‘1’ for key 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:657)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
… 9 more
Loyal WaterMemberCan you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.
Can you switch to a new workspace and test this project again. Do you still face the same issue ?
NiloofarMemberThis message has not been recovered.
Loyal WaterMemberThis message has not been recovered.
amir55ParticipantHi dear
I have the same problem which is so odd as my simple appl worked in package one so when I just copy the same code into package two after of course changing the package references only.
MyEclipse could not allow updating. sometimes I need to drop the database and recreate it and sometimes I use new database which is a bug I suppose but this time the error stays constant.
I got this error
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:253)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2232)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at common.HibernateDAOImpl.update(HibernateDAOImpl.java:232)
at common.SpringDAOManager.update(SpringDAOManager.java:66)
at common.SpringDAOManager$$FastClassByCGLIB$$61cd036b.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:624)
at common.SpringDAOManager$$EnhancerByCGLIB$$8320981b.update(<generated>)
at common.ClientHandler.update(ClientHandler.java:91)
at one_to_many_bi.Client.main(Client.java:23)
Caused by: java.sql.BatchUpdateException: Duplicate entry ‘1’ for key ‘PRIMARY’
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:657)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
… 19 moreyours
Amir
dakshinnMember“Duplicate entry ‘1’ for key ‘PRIMARY’ ” – Check you are trying to insert duplicate value for the primary key value.
-
AuthorPosts