-->
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.  [ 6 posts ] 
Author Message
 Post subject: How hibrenate demarca transaction with stored procedures
PostPosted: Tue Jan 15, 2008 1:56 pm 
Newbie

Joined: Tue Jan 15, 2008 1:51 pm
Posts: 3
We mix hibernate with stored procedure using Websphere application server and container managed transaction. When stored procedure finishes, it commits its transaction and cannot be rolled back when there is a need of such. Do we have to use userTransaction to demarcate the transaction in hibernate so that the stored procedure doesn't commit itself? Please give us suggestions. Thanks.


Top
 Profile  
 
 Post subject: Re: How hibrenate demarca transaction with stored procedures
PostPosted: Tue Jan 15, 2008 2:23 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
yanj@us.ibm.com wrote:
We mix hibernate with stored procedure using Websphere application server and container managed transaction. When stored procedure finishes, it commits its transaction and cannot be rolled back when there is a need of such. Do we have to use userTransaction to demarcate the transaction in hibernate so that the stored procedure doesn't commit itself? Please give us suggestions. Thanks.



Are these two things happening in the same thread? Do you know if your connection pool returns the same connection for each thread?


Farzad-


Top
 Profile  
 
 Post subject: How hibrenate demarca transaction with stored procedures
PostPosted: Tue Jan 15, 2008 3:06 pm 
Newbie

Joined: Tue Jan 15, 2008 1:51 pm
Posts: 3
One connection and one thread.


Top
 Profile  
 
 Post subject: Re: How hibrenate demarca transaction with stored procedures
PostPosted: Wed Jan 16, 2008 1:22 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
yanj@us.ibm.com wrote:
One connection and one thread.


Sorry for getting back to you so late. I did a little test with mixing stored procedures and hibernate modifications and it does rollback the changes caused by stored procedure, even if I force a commit in stored procedure. Therefore, it is possible that the call to sp and the call for other modifications are being handled through different connections in your case. I would be able to give you more help if you explain me more of what is happening in your application.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 2:15 pm 
Newbie

Joined: Tue Jan 15, 2008 1:51 pm
Posts: 3
Wow. What J2EE container are you using and how do you configure? We use Websphere Application Server and other technologies are

WebSphere 6.1, WebSphere Portal 6.0, Hibernate 3.0, Oracle 10g, JDK 1.4.1.

How do you demarcate your transaction? using CMT (container managed transaction) or userTransaction?

Thanks for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 16, 2008 3:19 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
yanj@us.ibm.com wrote:
Wow. What J2EE container are you using and how do you configure? We use Websphere Application Server and other technologies are

WebSphere 6.1, WebSphere Portal 6.0, Hibernate 3.0, Oracle 10g, JDK 1.4.1.

How do you demarcate your transaction? using CMT (container managed transaction) or userTransaction?

Thanks for your help.



I used JBoss 4.0.5 and I used Spring with a JTA transaction manager so spring does the demarcation for me but that's not much of magic here. I do believe your second call is within another transaction but you should be able to test this by verifying EJB transaction settings. I also suggest you wire hibernate and the container's transaction manager, even though I am not aware if this has any impact on rollback since it should be kinda handled in jdbc level, but you might want to give it a try. What is the call sequence?


Farzad-


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