-
1. Re: Seam+CDI Event Probleam - Observer does not work
lucaster Jan 7, 2013 5:06 AM (in response to filosofisto)Hi, Eduardo!
Does your observer method simply not get fired, or do you get an exception? Could you please post the stacktrace?
Try this:
- Make PersistenceEvent a @Stateful EJB
- Add @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) to the observer method
Also, there might be errors in your code:
dao.merge(entitySelected);
Should be:
entitySelected = dao.merge(entitySelected); -
2. Re: Seam+CDI Event Probleam - Observer does not work
filosofisto Jan 7, 2013 7:42 PM (in response to lucaster)Hi Cavagnoli,
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?
-
3. Re: Seam+CDI Event Probleam - Observer does not work
lucaster Jan 15, 2013 9:24 AM (in response to filosofisto)The event does not get fired at all? Maybe the update() method is never called...
Try add a log statement before evtUpdate.fire(t);
-
4. Re: Seam+CDI Event Probleam - Observer does not work
filosofisto Jan 16, 2013 12:54 PM (in response to lucaster)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!!!
Strange