i am trying to get the UserTransaction working with Hibernate, but having massive problems in resolving my issues.
I already did what has been written in hibernate tutorials with usertransactions and jboss, but hibernate won't synchronize with the JTA.
Generally i do the following in my application:
0) SessionFactory set up
1) In each Constructor of a bean: getting the UserTransaction and beginning it (works without hibernate)
2) try to get the current session in hibernate (won't work-->Exception)
3) try to use the getters and setters of my loaded objects (won't work because of 2)
4) in finalize method of each bean: commit the transaction (won't work because of 2 - but without hibernate it works fine)
I try to get hibernate not to load the complete object-path at once. I thought to use jbossusertransaction and wrap my application with it (step 1-4): If i call a get-method of my objects in step 3) hibernate will load it once the get-method is accessed. But i won't get that far because i am stuck in 2).
Maybe i did something wrong or somebody knows a better way to use transactions in jboss with hibernate.
Many thanks in advance,
Sorry to hear you are having problems. Please can you tell me exactly what versions of JBoss Transactions and Hibernate you are using, and more about the configuration. Ideally, please supply a test case that shows the problem. I'll take a look at it once the effects of the JBossWorld party have worn off :-)
JBoss Transactions team.