-->
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: Opening hibernate session:
PostPosted: Thu Mar 19, 2009 8:28 pm 
Newbie

Joined: Thu Mar 19, 2009 8:19 pm
Posts: 12
Hi I am new to hibernate and have a problem that I need to solve:

I am using a postGIS with hibernate.

This is the series of events that are happening:

I retrieve object A in session X..

I retrieve object B in session X.


then down the road I want to call A.contains(B) in session Y.

however because contains() is a registered function that is defined in my dialect I need to open another session before this call can be made.

Any ideas on how I could open another session?

Thanks for your time.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 19, 2009 8:50 pm 
Newbie

Joined: Fri Sep 26, 2003 1:50 pm
Posts: 9
Sounds like a long conversation with detached objects. Take a look at the user guide sections 11.1 and 11.3.3.

[url]http://www.hibernate.org/hib_docs/v3/reference/en-US/html_single/#transactions
[/url]

/Ross.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 20, 2009 1:38 pm 
Newbie

Joined: Thu Mar 19, 2009 8:19 pm
Posts: 12
Hi

thanks for your reply. I have read that article once before and now, but I am looking for a way to have hibernate automatically take care of opening the session. Is that possible?


The function contain() is called at the service layer.


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.