-->
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: Multiple Transactions within a session
PostPosted: Fri Apr 08, 2005 11:42 am 
Regular
Regular

Joined: Wed Jan 19, 2005 4:52 pm
Posts: 61
Location: Kansas City, USA
Using Hibernate 3 , and I am trying to run multiple transactions within the same session.

OpenSession
OpenTrans
DoSomething
CloseTrans
OpenTrans
DoSomething
CloseTrans
OpenTrans
DoSomething
CloseTrans
OpenTrans
DoSomething
CloseTrans
CloseSession

I keep getting this error.
JDBC begin failed
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Object has been closed.

I step through the code, I am able to open the session execute my first transaction, then I execute a procedure outside a transaction (stored procedure using the session.getConnection and then CallableStatement) then try to begin a new transaction, this goes to the HibernateUtil file, beginTransaction gets the session and attempts to do a session.beginTransaction() this is where I am getting the error.

Thanks
Tim


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 12:01 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Try with jTds. This is a better driver than the one provided by MS

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 1:17 pm 
Regular
Regular

Joined: Wed Jan 19, 2005 4:52 pm
Posts: 61
Location: Kansas City, USA
Downloaded the jTDS driver and put it in my classpath. Is this correct for the cfg file? I think I read it right.


<property name="connection.url">jdbc:jtds:sqlserver://sqlstage2:1433/nations</property>
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="connection.password">*******</property>
<property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 08, 2005 4:44 pm 
jTDS Developer
jTDS Developer

Joined: Tue Feb 24, 2004 5:36 pm
Posts: 70
Location: Bucharest, Romania
Looks right to me. Does it work?

Alin,
The jTDS Project.


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.