File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt about JPA PostRemove and PostUpdate events

 
Paul.J Wong
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have a doubt about PostRemove and PostUpdate events in JPA. I am reading the Pro JPA 2 book, on page 327, it states "When the SQL for deletion of an entity finally does get sent to the database, the PostRemove event will get fired. As with the PostPersist lifecycle event, the PostRemove event does not guarantee success. The enclosing transaction may still be rolled back".

As I learned, transaction can either commit, or rollback. In the sentence, if the deletion SQL does get sent to the database, that means the transaction is already committed, how come it may still be rolled back?

Thanks in advance.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic