Does your observer method simply not get fired, or do you get an exception? Could you please post the stacktrace?
- Make PersistenceEvent a @Stateful EJB
- Add @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) to the observer method
Also, there might be errors in your code:
entitySelected = dao.merge(entitySelected);
I have corrected dao.merge() and tried @Statefull with @TransactionAttribute(TransactionAttributeType.REQUIRED), REQUIRED_NEW is not an option cause we can have a chain of calls within the same transaction.
Simply observer does not get fire, very strange.
Any more ideas?
The event does not get fired at all? Maybe the update() method is never called...
Try add a log statement before evtUpdate.fire(t);
Hi Cavgnoli, in reality evtUpdate.fire(t) is executed, because I have debugged code and confirm the event fire.
But, event don't is realized by observe method!!!