-->
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.  [ 4 posts ] 
Author Message
 Post subject: transactions and sessions
PostPosted: Fri Sep 02, 2005 11:22 am 
Newbie

Joined: Tue Aug 23, 2005 11:38 am
Posts: 14
we are using hibernate 3.0.5

We create the session,
begin a transaction
do some work
commit transation
begin transaction
try to do some more work and get error saying unable to obtain session.


So, what happens one you commit transacion? Do you loose the session?

How do you do multiple commits with the same session?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 12:35 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
You can have > 1 transaction for a session.

Can you elaborate on "unable to obtain session"? Is it closed? Is it misplaced in a different thread local ? are you calling SessionFactory.getCurrentSession() in a managed environment w/ a misconfigured JTA?


Top
 Profile  
 
 Post subject: Re: transactions and sessions
PostPosted: Fri Sep 02, 2005 1:14 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
http://www.hibernate.org/ForumMailingli ... AskForHelp

Show your code!

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 1:33 pm 
Newbie

Joined: Tue Aug 23, 2005 11:38 am
Posts: 14
I'm in a non managed environment.

I obtain the session by..
session = HibernateSessionFactory.currentSession();

After I call commit, I perform a load using session to get my next class to work on...
Dog dog = (Dog) session.get(Dog.class, dogcelOID);

And get this exception..
FINE: loading entity: xxxxxxxx
Sep 2, 2005 1:29:10 PM org.hibernate.jdbc.AbstractBatcher logOpenPreparedStatement
FINE: about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
Sep 2, 2005 1:29:10 PM org.hibernate.event.def.DefaultLoadEventListener onLoad
INFO: Error performing load command
org.hibernate.HibernateException: Not able to obtain connection
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:113)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.