Announcement Announcement Module
Collapse
No announcement yet.
@Transactional is not creating a transaction while using JPA (JTA Implementation) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I have attached the files.

    Comment


    • #17
      I have added the @Transactional annotation to the saveNewConcept method in the service impl class. Now i see a diffnt exception and now the stack trace is hitting the transaction interceptor.

      But the underlying error is "ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!"

      I am saving this exception as Excetion.txt file in the attachments as i cant post the entire exception.

      Comment


      • #18
        I wouldn't use getResultList().get(0) I would use getSingleResult() and cast it to a Long. To solve your exception figure out why it is happening, maybe wrong hibernate classes, maybe something else marked the transaction as rollback can be variety of issues. (You might want to ask yourself the question do you really need JtaTransactions do you have multiple transactional resources which need to participate in the same transactions, if the question is no, I wouldn't use JTA).

        To troubleshoot your issue I would enable debug logging and try to figure out what is happening with the transaction.

        Comment


        • #19
          Yes i need to Use JTA for my project.
          As you were pointing out the transaction is getting rolled back. I see this info on t he UI (we are using flex as our front end) but not in the stack trace
          Code:
          org.springframework.transaction.UnexpectedRollbackException : JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Could not commit transaction.
          I did check the timeout for the JTa transaction on the jboss server and it is set to 300(5 minutes) which i think should be more than enough for my transaction.

          Comment


          • #20
            That is why I suggest to enable debug logging to see what is happening and why the transaction gets marked as rollback only...

            Comment

            Working...
            X