-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: JBoss integration
PostPosted: Thu May 27, 2004 2:21 pm 
Newbie

Joined: Thu May 27, 2004 2:14 pm
Posts: 4
Hi

When I use net.sf.hibernate.transaction.JTATransactionFactory and update date tables, it indicates successfully. But the content in database didn't change. But when use net.sf.hibernate.transaction.JDBCTransactionFactory, it works fine. Does anyone know why and how to solve it?

Fine settings:
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>

Problem settings:
<property name="transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>

The code for update looks like:

Session session = null;
Transaction transaction = null;
try {
session = ServiceLocator.getConnection();
transaction = session.beginTransaction();

session.saveOrUpdate(object);
session.flush();
transaction.commit();
return customer;
} catch (HibernateException e) {
if (transaction != null) {
try {
transaction.rollback();
} catch (HibernateException e1) {
throw new DAOException(e1);
}
}
logger.error(e.getMessage());
throw new DAOException(e);
} finally {
if (session != null) {
try {
ServiceLocator.closeConnection();
} catch (HibernateException e) {
logger.warn(e.getMessage());
}
}
}

Thanks for help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.