Abstractflushingeventlistener Error Could Not Synchronize Database State With Session
Contents |
here for a quick overview of the site Help Center Detailed answers to could not synchronize database state with session could not execute jdbc batch update any questions you might have Meta Discuss the workings and nhibernate could not synchronize database state with session policies of this site About Us Learn more about Stack Overflow the company Business Learn more oracle could not synchronize database state with session 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
Could Not Synchronize Database State With Session Row Was Updated Or Deleted By Another Transaction
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 Could not synchronize database state with session Exception in hibernate up vote 1 down vote favorite 1 I have a table bean as : public class Employee implements could not synchronize database state with session grails Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @Column(name = "employee_id", unique = true, nullable = false) @Basic(fetch = FetchType.EAGER) private long id; } and when i try to insert row in database an Exception appear "Could not synchronize database state with session": 19658 [http-bio-8080-exec-2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null 119658 [http-bio-8080-exec-2] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into employee (basic_salary, code, fk_department_id, email, first_name, ip_phone_extension, is_default, last_name, password, threshold, voice_model, voice_validate, employee_id) values (NULL, 222, NULL, admi222222222n@xeno-solutions.com, sdfasfd, 21312, 0, fdsafsad, 2, NULL, NULL, NULL, 10) was aborted. Call getNextException to see the cause. 119658 [http-bio-8080-exec-2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505 119658 [http-bio-8080-exec-2] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "employee_pkey" Detail: Key (employee_id)=(10) already exists. 119658 [http-bio-8080-exec-2] ERROR org.hibernate.event.def.AbstractFlushingEventListener - 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:96) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java
here for a quick overview of the site Help Center severe: could not synchronize database state with session Detailed answers to any questions you might have Meta Discuss
Org.hibernate.exception.constraintviolationexception: Could Not Execute Jdbc Batch Update
the workings and policies of this site About Us Learn more about Stack Overflow
Org Hibernate Stalestateexception Batch Update Returned Unexpected Row Count From Update 0
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x http://stackoverflow.com/questions/8299378/could-not-synchronize-database-state-with-session-exception-in-hibernate 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 minute: Sign up Could not synchronize database state with session up vote 1 down vote favorite 1 Could not synchronize database state http://stackoverflow.com/questions/18559714/could-not-synchronize-database-state-with-session with session org.hibernate.exception.GenericJDBCException: could not update I am getting this error while I try to update my database. There is no unique key defined in my database, but id field has been defined as Primary Key. Here is the code of the update function : public String updateAction(){ Session session = null; try{ SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session =sessionFactory.openSession(); org.hibernate.Transaction tx = session.beginTransaction(); Medicine medicine = (Medicine) session.load(Medicine.class, id); medicine.setBrandName(brandName); session.update(medicine); tx.commit(); } catch(Exception ex){ ex.printStackTrace(); } finally{ session.close(); } return "index"; } hibernate.config.xml:
Search Forums Home » Liferay Portal » English » Liferay Legacy Recent Posts Statistics RSS (Opens New Window) Answer (Unmark) https://web.liferay.com/community/forums/-/message_boards/message/94184 Mark as an Answer Threads [ Previous | Next ] Could not synchronize database state with session Chad Shryock December 13, 2006 6:10 AM RE: Could not synchronize database state with session Jean-Sébastien Hederer January 8, 2007 2:23 AM RE: Could not synchronize database state with session Chad Shryock could not January 9, 2007 3:43 PM RE: Could not synchronize database state with session Marco Scavazzon January 18, 2007 5:06 AM RE: Could not synchronize database state with session bryan h ho January 25, 2007 7:16 AM RE: Could not synchronize database state with session Chad Shryock January 25, 2007 could not synchronize 10:54 AM RE: Could not synchronize database state with session Joseph Shum January 25, 2007 11:54 AM RE: Could not synchronize database state with session Chad Shryock January 25, 2007 6:17 PM RE: Could not synchronize database state with session Joshua Asbury January 28, 2007 2:19 PM RE: Could not synchronize database state with session Jaime Luis López August 7, 2007 3:11 AM RE: Could not synchronize database state with session Saurabh Bobde September 1, 2009 7:26 AM Could not synchronize database state with session December 13, 2006 6:10 AM Answer Chad Shryock Rank: Expert Posts: 285 Join Date: August 26, 2006 Recent Posts Hello,I just saw this error go by in my log:12006-12-13 09:08:53,828 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session2org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update3 at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)4 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)5 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)6 at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java: