I use a Hibernate session in a MBean method in the following way:
| InitialContext context = new InitialContext();
| SessionFactory factory = (SessionFactory)
context.lookup(SESSION_FACTORY_JNDI_NAME);
| session = factory.openSession();
| Transaction tx = session.beginTransaction();
| try {
| MyDAO o = (MyDAO) session.load(MyDAO.class, "key1", LockMode.UPGRADE);
| ....
| tx.commit();
| } catch (Exception e) {
| tx.rollback();
| }
|
But autocommit of the underlying JDBC connection is true, and the record is
not locked during the processing.
The Transaction is an JTATransaction.
When I set autocommit to of manually, then the record is locked, but the
tx.commit does not pass the commit to the underlying JDBC connection.
Maybe a missing configuratin for the TransactionManager or UserTransaction.
Who have any ideas?
Thank you for your assistence.
Ramses
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3873210#3873210
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3873210
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user