• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Any one there? I would be grateful for ant help....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic