-->
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: Possible Session bug when providing my own jdbc connections?
PostPosted: Thu Oct 14, 2004 10:13 am 
Newbie

Joined: Thu Oct 14, 2004 10:00 am
Posts: 2
Location: New York
Not sure if this is the desired behavior here, however, I am providing my own database connections on session creation. I am using the Session as a cache for retrieving specific user data within form fields for prepopulating them. I do not have a datasource defined in my hibernate properties since I am providing my own connections at session creation.

What I'm doing is calling sessionFactory.openSession() without passing in a jdbc connection which gets me a Session without a db connection. However I notice the isConnected() method returns true. I could get around that by calling session.disconnect(). Now here comes the weird part. Before retrieving data, I call session.reconnect() and pass in a jdbc connection. If I then call session.disconnect() after I'm done, I get an UsupportedOperationException and the session says I need to provide a jdbc connection. This behavior doesn't happen if I initially open the session with a jdbc connection and call disconnect() then reconnect() repeatedly.

It seems questionable why I am doing this, however, I'm trying to not tie up my database connections since they're very "precious". :)

I know this is probably atypical behavior, however, it seems that the session object shouldn't behave this way.

If anyone has any comments, etc, I'd be more than happy to read them.

-John

_________________
---
John Caruso
Senior Nut
ivillage.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 19, 2004 4:48 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Please post it to JIRA, there is a little hole in our treatment because we use a lazy connecting sterategy.
A usable testcase would be cool

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 25, 2004 3:05 pm 
Newbie

Joined: Thu Oct 14, 2004 10:00 am
Posts: 2
Location: New York
Okay, I will try to get it in tonight -- things are a little hectic lately. :)

_________________
---
John Caruso
Senior Nut
ivillage.com


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.