Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Hibernate and JTA

Thread Tools

Hibernate and JTA

TH Lim
Posts: n/a

I am using JTA as my transaction demarcation in my servlet under Orion
AppServer. MySQL is the database Orion is connected to. My code that
forces a rollback looks like this,

utx.begin(); // UserTransaction.begin()
// session is an instance of net.sf.hibernate.Session
q = session.createQuery("from Account as acc order by");
clients = q.list();
for (Iterator clientIter = clients.iterator();
clientIter.hasNext() {
Account acc = (Account);
acc.setBalance(acc.getBalance() - 500);

clients = q.list();
for (Iterator clientIter = clients.iterator();
clientIter.hasNext() {
Account acc = (Account);
log(acc.getName() + " with balance " +


I updated Account's balance to a new value and forced a rollback. So
when I reread the balance, it should give me the previous value.
Right? What have I done wrong here? It works with Hibernate own's
transaction mechanism. Pls. advise.Thank you.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Right use for JTA transactions? Scott Balmos Java 6 03-16-2010 09:10 PM
JTA support for non XA drivers/connections Java 1 03-03-2007 04:06 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Distributed transactions using JTA and JTS Distrans Java 0 01-13-2005 06:19 PM
standalone JTA transaction manager MetroFix Java 1 09-08-2003 09:22 AM