• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction

 
Ashok Kumar
Greenhorn
Posts: 7
Chrome Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.IllegalStateException: Transaction already active

Please give the solution for this am new to JPA.
I have correctly give the begin transaction & commit it
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ashok Rocks",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first question would be are you running inside a EJB Container such that there is already a JTA Transaction started for you? and you might also be injecting the EntityManager?

But that is a guess because there are some important details we are missing. If you are in a container and it is giving you a JTA Transaction and handling the transactions, they you don't have to beginTransaction() yourself.

But if I am wrong, please post more info, like your environment and some code.

Thanks

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic