-
1. Re: When is WorkItemInfo table get inserted?
swiderski.maciej Oct 8, 2013 1:08 AM (in response to coconut788)that most likely means that you complete your work item within the same transaction as it was created and thus it won't be persisted since work item is removed once it's completed. Check your work item handler and make sure you don't complete it within you executeWorkItem method.
HTH
-
2. Re: When is WorkItemInfo table get inserted?
coconut788 Oct 8, 2013 11:01 AM (in response to swiderski.maciej)Hi Maciej,
I am pretty sure that I do not complete the workItem in excuteWorkItem(). When debugging, after excuteWorkItem() method, I do see workItemInfo object. But somehow it is just not persisted into DB.
And it is interesting to see that line 38, "em.persist(workItemInfo)", of JPAWorkItemManager.java is commented out. And it decided to use the following lines to persist WorkItemInfo:
PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext();
context.persist( workItemInfo );
Do I need to configure PERSISTENCE_CONTEXT_MANAGER ?
Thank you.
-
3. Re: When is WorkItemInfo table get inserted?
coconut788 Oct 16, 2013 4:33 PM (in response to swiderski.maciej)Hi Maciej,
I am still trying to debug. It looks like it is a transaction problem, just like you said. But I am pretty sure I did not complete that work item, but no entries in the workItemInfo table. Do I need to add something like txm.commit() in order to let workItemInfo persist? The reason I am asking this is because I found after txm.commit(), sessionInfo is persisted into its table.
Thank you!