This content has been marked as final.
Show 2 replies
-
1. Re: Is using an entityManager during postInitialization bad form?
zaya May 10, 2008 2:56 AM (in response to jgilbert)Normally your transaction is started by SeamPhaseListener. PostInitialization is out of the scope of SeamPhaseListener, so you have to start transaction manually.
try surround your code with
Transaction.instance().begin();
and
Transaction.instance().commit();
-
2. Re: Is using an entityManager during postInitialization bad form?
pmuir May 12, 2008 5:59 PM (in response to jgilbert)
Yenan Zhou wrote on May 10, 2008 02:56 AM:
Normally your transaction is started by SeamPhaseListener. PostInitialization is out of the scope of SeamPhaseListener, so you have to start transaction manually.No you don't, the transaction interceptor should start the transaction for you. This should work as you have posted IIRC.