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: Executing native SQL within the same transaction
PostPosted: Tue Oct 31, 2006 3:39 am 
Newbie

Joined: Thu Jun 30, 2005 10:29 am
Posts: 4
Good day,
I have to execute session.save() and my stored procedure in the same transaction.
My stored proc doesn't return resultset - it is used for update/insert.
This sort of stored procs is not supported by Hibernate through native SQL queries. So, I use session.connection().
But apparently, my stored proc is NOT executed in the same transaction.

Am I doing something wrong or this is the way it supposed to be?

I configured session factory with hibernate.current_session_context_class=thread.
and get session using factory.getCurrentSession()

Hibernate ver. 3.1.2
MS SQL Server 2000

I'd appreciate any help
Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 6:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
h3.2 has support .executeUpdate() with native sql.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 31, 2006 9:09 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Probably "autocommit" is on, "session.connection()" works without problems.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 11:30 pm 
Newbie

Joined: Thu Jun 30, 2005 10:29 am
Posts: 4
max wrote:
h3.2 has support .executeUpdate() with native sql.


Thanks! That'll solve all my problems.

P.S. the autocommit is off, but thanks anyway =)


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.