• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rollback not working in Hibernate

 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my code i am doing some updates in group. What i have to do is if during any updation if there is some exception, the previous save should rollback to old data.
This thing is not happening.Eg:- Here I am purposely throwing exception at 4th update to check if the previour 3 updates are rollbacked or not.
They are not rollbacked in DB. My DB is Oracle 10g

Please help




And yes i have added this entry to hibernate.cfg.xml file : <property name="hibernate.connection.autocommit">false</property>
 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody please
 
sumit anand kumar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close this thead. This code was running in a while loop which had another transaction processing simultaneously. Had to remove its Transaction.commit

Now the code works as expected
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic