-->
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: Keep session open in CMT transaction
PostPosted: Tue Aug 08, 2006 6:03 pm 
Newbie

Joined: Tue Apr 11, 2006 4:57 am
Posts: 17
Hibernate version: 3.1.3

We are using Websphere Application Developer (and Websphere Process Server) and EJB 2.1 (stateless session) and we have a problem with the Hibernate session.

We have separate layer for data access (there are some Hibernate persistent objects -DataBase Objects- and some stateless session beans for get data from database (uses HQL and session.load()). For this layer (and for Hibernate) we use CMT connection factory and CMT transaction manager. Session bean methods returns lazy DataBase Objects (not initialized).

In the application workflow (business processes) we can only use DataObjects so we have to map every DataBase Object to DataObject. This happens in another layer, so session should be still opened in this layer to initialize DataBase Objects.

The problem is that if we want to access a lazy relationship in this layer, we get de LazyInitializationException because the session is closed. I think the CMT transaction manager closes the session automatically when the method finishes and when accesing the session in the mapping layer to acces a lazy relationship, it has been previously closed.

Is there any idea how to force the session to remain open after returning from stateless session bean method using global transaction?


Top
 Profile  
 
 Post subject: Again
PostPosted: Thu Nov 02, 2006 4:31 am 
Newbie

Joined: Tue Apr 11, 2006 4:57 am
Posts: 17
Nobody has replyed my question...but my problem still exists...

Can anybody answer it????


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 02, 2006 5:10 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
"Is there any idea how to force the session to remain open after returning from stateless session bean method using global transaction?"
There is no correct way to do it using stateless session beans, try statefull CMT beans and demarcate transaction on client (see UserTransaction interface).


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.