-->
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: Hibernate 2.1 - can I mix Connection and Session processing?
PostPosted: Fri Sep 16, 2005 2:46 pm 
Newbie

Joined: Thu Feb 03, 2005 11:40 pm
Posts: 8
Hi,

I am porting an existing JDBC application to Hibernate 2.1. I came to a point where I need to invoke some stored procedures. As far as I know, 2.1 does not support stored procedures.

My plan is to have some JDBC code that invokes the stored procedure using an SQL Connection that I get from the Hibernate session (conn = sess.connection();). However, I would like to make use of the Hibernate session to process some HQL statements as well. Can I do that, i.e., mix HQL with JDBC?

The documentation states that I need to manually commit/rollback anything I have done using the Connection but does not specify what should I do with the Hibernate Transaction. Can I rely on the Hibernate transaction to commit everything that I have done in the stored procedure, since it is working off the same Connection?

Thanks,
Vladimir


Top
 Profile  
 
 Post subject: it depends
PostPosted: Mon Sep 19, 2005 1:31 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
It looks like H2 will take care of transactions, but H3 will not if its connection manager is in 'agressive mode' in this case H3 Session.connection() returns new connection in 'agressive mode' .

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 1:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
aggressive mode are used on appropriate environments that keep track of connection consistency regarding tx demarkation (in an app servers for example).

_________________
Emmanuel


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.