Meaningless Drivel is fun!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Error using Resource Local Entity Manager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Error using Resource Local Entity Manager" Watch "Error using Resource Local Entity Manager" New topic
Author

Error using Resource Local Entity Manager

Steven Lennon
Greenhorn

Joined: Aug 23, 2009
Posts: 5
Hi All,

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error using Resource Local Entity Manager
 
Similar Threads
Java Persistence API: Multiple Persistence Units problem
JAX-WS based WS using EntityManager to persist data to DB
Transaction Scoped Persistence Contexts
no error but entity is not persisted
Error in LookUP in JBOSS 5.0.0.Beta4 EJB3.0