• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

java.lang.IllegalStateException: Exception Description: Cannot use an EntityTransaction while using

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to all.

I am new to JPA thing and i have been given a code to debug. The initial implementation involved using EclipseLink but we had memory leak issues with that
now we switched to Toplink and the issue is solved now.
But it creates another problem ...

The persisting code(the code which persists the entities) actually uses EntityTransaction as well as UserTransaction(Please clarify me on this as to what is the difference between them as I am new to JPA) and my persistence.xml has this line


the code works fine when using eclipselink but as i mentioned earlier that we switched to toplink,when run with Toplink in operation it gives the following error



I don't know what is happening here. Can any one please suggest me a workaround for this problem. I can't seem to understand why eclipselink is allowing that code to run successfully.

Here is the code... The code is written in such a way that when I want to persist an Entity I first get EntityTransaction usninn below method and then persist the file using
em.persist(entity) and then calling -commitTransaction() method





and another method is



Thanks in advance for any help.....




 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any one there? I would be grateful for ant help....
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic