Hi,

We're trying to get rid of few triggers in the database, but are struggling 
with finding a solution in the ejb3 land. The triggers we're struggling in 
particular are "after insert" triggers that update other record fields or 
insert records in same or other tables. 

First, it took us a while to figure out why within the same transaction the 
entities affected by the trigger would not reflect the data in the database.

Second, we wanted to replace the triggers with java code, and @PostPersist 
EntityListeners or Callbacks seemed perfect for this, where we thought we could 
create new entities or find existing ones that need updating, and then use 
entity manager to persist data. However, we could not find a way to get a 
handle to the EntityManager.

What is the correct way of doing this?

Also, in a @PostUpdate or @PreUpdate, is there a way to find old AND new values?

Thanks & Regards

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966176#3966176

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966176
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to