-->
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: Warnings on Session finalization
PostPosted: Thu Dec 18, 2003 12:27 pm 
Newbie

Joined: Mon Sep 15, 2003 10:07 am
Posts: 8
Location: Stuttgart, Germany
Hi,

I'm using Hibernate 2.1.1 with jBoss 3.2.2. When my Hibernate Session objects get finalized I get these strange warnings:

16:55:14,796 WARN [SessionImpl] afterTransactionCompletion() was never called


Do I have to care about these warnings? Is it possible that changes to the database are not commited when I get these warnings?

BTW I am using the recommended Hibernate session usage pattern:

Code:
Session sess = factory.openSession();
Transaction tx = null;
try {
    tx = sess.beginTransaction();
    // do some work
    ...
    tx.commit();
}
catch (Exception e) {
    if (tx!=null) tx.rollback();
    throw e;
}
finally {
    sess.close();
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 19, 2003 9:53 am 
Newbie

Joined: Mon Sep 15, 2003 10:07 am
Posts: 8
Location: Stuttgart, Germany
I found the reason for my problem. I forgot to do a tx.commit() or tx.rollback() after catching an ObjectNotFoundException thrown by Session#load.

Ralf


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.