This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am study for the SCBCD exam and trying out different scenerios with JTA and Resource Local Managed Entity Managers. I came across this scenerio which I can't explain what is happening. I am receiving the following error and I'm not sure why.
The code I am using is as follows;
My persistence.xml file is as follows;
The main point is when I have the @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) annotation on the runAccount() method I get the following Exception;
However, if I remove the @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) annotation (which defaults to TransactionAttributeType.REQUIRED) the method works as expected.
My problems is I don't understand why adding @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) annotation would cause the exception as I was under the impression that a Resource-Local Entity Manager does not have to use JTA or container managed transactions and therefore if a container managed transaction was not present (using the NOT_SUPPORTED option) it shouldn't matter. What also adds to my confusion is in the stack trace I see a reference to a org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:147) class which refers to a JTA delegate and reinforces my belief that JTA is still involved in the Resource-Local transaction.
I would be very appreciative of your help and comments and let me know if I have missed something elementary here.
Thanks in advance.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Error using Resource Local Entity Manager