-->
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: HibernateSessionConversationFilter of wiki flawed ?
PostPosted: Mon May 12, 2008 5:23 pm 
Newbie

Joined: Tue Dec 27, 2005 10:39 am
Posts: 9
Hi i wanted to implement long running conversations (between multiple HTTP requests) and i translated the HibernateSessionConversationFilter
to a JSF phase event listener.
(too bad i am not using SEAM but that's another story).

But after reading the code i am wondering if there aren't any issues with exception handling in the given example.

For instance, the following code is executed when a Throwable is thrown:

Code:
log.debug("Unbinding Session after exception");
currentSession = ManagedSessionContext.unbind(sf);
log.debug("Closing Session after exception");
currentSession.close();


The problem is that the current session is already unbound (in the code) after filter chaining but before committing the transaction. Therefore currentSession returns null and NPE occurs.
Also sessionFactory.getCurrentSession() is executed in exception handling code which should throw a SessionException since in the CurrentSessionContextImpl the session is already unbound for the current thread.

Please let me know, if you already noticed this issue.

Thanks,
Luc


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.