Entity state and entity id value in JPA/Hibernate after rollback

后端 未结 2 1638
鱼传尺愫
鱼传尺愫 2021-01-13 17:00

What happens with Entities in session if I make rollback ? Do they get back to the state before transaction ? In particular do they get new ids ?

Example:

         


        
2条回答
  •  忘掉有多难
    2021-01-13 18:00

    All managed entites will become detached.

    Unless you are using an extended persistence context, rolling back also ends the persistence context.

    (see OpenJPA docs: http://openjpa.apache.org/documentation.html)

提交回复
热议问题