-->
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.  [ 3 posts ] 
Author Message
 Post subject: Query flushe's but does not commit in DB
PostPosted: Tue Apr 05, 2005 9:43 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
Hibernate version: 2.1.3

In an Interceptor of mine, I do a check to see if I should create a new child record (inventory) and this all works great.

Code:
try {
          Session sess = HibernateContext.getTemporarySession();
          processInventoryDestinationCheck(sess, (Shipment) entity);
          sess.flush();
          sess.close();
          //return false;
          return true;
} catch (Exception e) {
    LOG.error(e.toString());
    throw new CallbackException(e);
}


I even see the insert print out:

The generated SQL (show_sql=true): Hibernate: insert into inventory_history (user_id, old_inventory, new_inventory, create_date, tracking_number, product_id) values (?, ?, ?, ?, ?, ?)

But there are no records in the DB? Is there some sort of conflict with my Session and my Temp Session? I am using Proxool as my pool.

Any help would be appreciated.

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 1:20 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
you're sure, that your transaction-handling is correct?

gtx
curio


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 10:19 am 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
curio wrote:
you're sure, that your transaction-handling is correct?

gtx
curio



Good call, that was it. I was handling the session right, but I was not starting / commiting a transaction. Thanks.

Matt


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.