Hi All ,
iam using JPA/Hibernate (EntityManager 3.3.1) and ThreadLocal / Session Facade pattern of creating the EntityManager (Bean Managed) , i have a case where i should generate the ID of my entity during the @PrePersist callback , the generation of the ID depends on selecting the current value from the DB , my question is how can i ensure that the PrePersist and the Actuall Persisting operation will happened without interruption from other thread ( to avoid dirty read ) ,
Thanks and Best Regards,
|