• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error using Resource Local Entity Manager

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic