This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
@Transactional is not creating a transaction while using JPA (JTA Implementation)Page Title Module
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.
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
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.