-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate + JOTM + Tomcat = Database writes not happening.
PostPosted: Wed Mar 23, 2005 4:27 pm 
Newbie

Joined: Wed Jan 21, 2004 5:12 pm
Posts: 8
Hibernate version:2.1.6

Code between sessionFactory.openSession() and session.close():
//JOTM JTA Transaction already started....
MyObj obj;
Session ses;//actually doing my session getting here.
net.sf.hibernate.Transaction tx = ses.beginTransaction();
if( obj.getId() == null ) {//if the Long is Null then we need to save.
obj.setId((Long)ses.save(obj));
}
else {
ses.update(obj);
}
tx.commit();
//Session closing handled by a filter.
//JOTM JTA commit call handled by an outside class.

Full stack trace of any exception that occurs: No Exception Occurs

Name and version of the database you are using: Oracle 9.2

The generated SQL (show_sql=true):
Hibernate: select status_item_id_seq.nextval from dual
Hibernate: insert into status_item (description, item_number, message, packing_list, po_number, quantity, submit_time, user_id, retryable, viewable, status_state, building_id, dock_date, receiver_number, retried_status_item, status_item_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)


This is the jist of my code. What's happening, is that the inserts or updates don't get persisted to the database. I've stepped into JOTM's code, and it looks like it's doing it's commit stuff. I registered an object that implements javax.transaction.Synchronization and it's getting all the call backs it should when the transaction commits.

I've also checked the connection class that hibernate is geting from the JOTM DataSource and it's org.enhydra.jdbc.standard.StandardXAConnectionHandle, which I assume is what you get when JOTM is managing your connections. So I'm presently at a loss. Anyone have any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 3:28 pm 
Newbie

Joined: Wed Jan 21, 2004 5:12 pm
Posts: 8
So I deployed the same app to JBoss and commits work like a champ. Everything gets written like it should. So I guess it's JOTM's problem.


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

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.