Error Org Hibernate Util Jdbcexceptionreporter Duplicate Entry For Key
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Sql Error 1062 Sqlstate 23000 Hibernate
more about Stack Overflow the company Business Learn more about hiring developers or posting mysql sql error: 1062, sqlstate: 23000 ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community hibernate duplicate entry for key 'primary' Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Hibernate Save strange behaviour up vote 4 down vote favorite I have a user object that has a one-to-many relationship with String types. I believe they are simple mappings. The types table hold the associated user_id and variable type names, with a primary key 'id' that is basically a counter.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/1105734/hibernate-save-strange-behaviour minute: Sign up org.hibernate.util.JDBCExceptionReporter] Duplicate entry X for key 'PRIMARY' up vote 0 down vote favorite I am writing a back-end java code with active-mq in producer consumer model. When multiple consumers runs using and try to update in a table question the following exception is occured and the transaction is rollbacked. Multiple threads are running inside each consumer task. WARN [org.hibernate.util.JDBCExceptionReporter] http://stackoverflow.com/questions/17803470/org-hibernate-util-jdbcexceptionreporter-duplicate-entry-x-for-key-primary SQL Error: 1062, SQLState: 23000 07:10:31,609 ERROR [org.hibernate.util.JDBCExceptionReporter] Duplicate entry '69-947' for key 'PRIMARY' 07:10:31,615 ERROR [com.xminds.bestfriend.consumers.QuestionGeneration] Exception failed the Question generation org.springframework.dao.DataIntegrityViolationException: could not insert: [com.xminds.bestfriend.frontend.model.Friendship]; Any one can suggest a solution for this. java multithreading activemq share|improve this question edited Jul 23 '13 at 9:09 Peter Butkovic 3,64012147 asked Jul 23 '13 at 7:03 Vishnupriya 5139 2 Duplicate entry '69-947' for key 'PRIMARY' , it seems two threads are trying to insert a record with same PK ! How do you generate the PK ? –NINCOMPOOP Jul 23 '13 at 7:05 I am taking stream data from facebook for our application and inside the table post_id is used as primary key. –Vishnupriya Jul 23 '13 at 7:11 I want to know who generates the PK ? Is it auto generated or you provide the PK ? –NINCOMPOOP Jul 23 '13 at 7:14 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote I think your are trying to insert the record using existing primary key. Make sure the primary key is unique.
Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.
English » 3. Development Recent Posts Statistics RSS (Opens New Window) Answer (Unmark) Mark as an Answer Threads [ Previous | Next ] Duplicate entry '16206' for key 'PRIMARY' Ramesh Reddy January 22, 2013 10:49 PM RE: Duplicate entry '16206' for key 'PRIMARY' Jan Geißler January 23, 2013 3:12 AM RE: Duplicate entry '16206' for key 'PRIMARY' Ramesh Reddy January 24, 2013 12:34 AM Duplicate entry '16206' for key 'PRIMARY' January 22, 2013 10:49 PM Answer Ramesh Reddy Rank: Junior Member Posts: 32 Join Date: October 17, 2012 Recent Posts Hi All, I am facing constraint violation exception when i try to add a portlet to a page for the first time, In the UI it is showing error message like "There was an unexpected error. Please refresh the current page" and i am getting following exception in the console. when i refresh the page then i can see the portlet without any errors. Can any one help me how to solve this exception....06:16:36,970 ERROR [http-bio-2013-exec-9][JDBCExceptionReporter:76] Duplicate entry '16206' for key 'PRIMARY'06:16:37,186 ERROR [http-bio-2013-exec-9][status_jsp:665] javax.servlet.ServletException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch updatejavax.servlet.ServletException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840) at com.liferay.portal.kernel.servlet.PageContextWrapper.handlePageException(PageContextWrapper.java:161) at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:2014) at org.apache.jasper.runtime.HttpJspBase.s