-->
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: Persisting using EntityManager from a Servlet Listener
PostPosted: Mon Jul 11, 2011 3:53 pm 
Newbie

Joined: Mon Jul 11, 2011 3:15 pm
Posts: 1
I've run into a problem that so far I've been unable to find a work around for. In our web application we are using Hibernate 3.x (annotations) with the EntityManager to control our transactions and every time a call is made to the service layer from the client we have a servlet listener that intercepts and examines the request/session to make sure the user is already authenticated and if not authenticate them and add them to our DB. The problem is that when we try to persist the user to the data layer nothing happens since the hibernate session is closed.

I have tried multiple things to try and get the User object to persist including (but not limited to) trying to get/open a session by calling:
Code:
Session session = (Session) entityManger.getDelegate()

But no matter what I do the session is always closed and can’t be re-opened.

I was wondering if anyone else has encountered issues like this before and how they overcame them. We’re running our application in Tomcat 6x and are utilizing Spring MVC but are not using the MVC for the user authentication piece of the tool. Any help that can be given with this would be greatly appreciated.


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.