-->
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.  [ 1 post ] 
Author Message
 Post subject: SQL Exc : mfg_voidCarton was called outside of transaction
PostPosted: Tue Feb 08, 2005 10:52 am 
Newbie

Joined: Tue Feb 08, 2005 10:32 am
Posts: 1
Location: India
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1

Full stack trace of any exception that occurs:

2005-02-08 19:56:53,575 DEBUG (SessionImpl.java:555) - opened session
2005-02-08 19:56:53,575 INFO (HibernateSF.java:53) - Opening a Session
2005-02-08 19:56:53,575 DEBUG (JDBCTransaction.java:37) - begin
2005-02-08 19:56:53,575 DEBUG (JDBCTransaction.java:41) - current autocommit status:true
2005-02-08 19:56:53,575 DEBUG (JDBCTransaction.java:43) - disabling autocommit
2005-02-08 19:56:53,591 INFO (HibernateSF.java:119) - In openConnection
2005-02-08 19:56:53,606 ERROR (ManageCartonsSF.java:581) - Error in voidCarton() while executing SP
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]mfg_voidCarton was called outside of transacti
on

Name and version of the database you are using: MS SqlServer 2000 (Driver com.microsoft.jdbc.sqlserver.SQLServerDriver )

WebLogic 8.1

The code is as follows :
JAVA Class
try {
openSession();
con = openConnection();
beginTransaction();
callStmt = con.prepareCall(
"{call mfg_DeleteLastProductStatus(?,?)}");

callStmt.setInt(1, productId.intValue());
callStmt.setInt(2, statusId.intValue());
callStmt.executeUpdate();
commitTransaction();
}

Store Proc : mfg_DeleteLastProductStatus

CREATE PROCEDURE mfg_DeleteProductStatusForProductIdAndStatus
@product_id int = null,
@status_code char(2) =null
AS
begin
if ( @@trancount = 0 )
begin
RAISERROR ('mfg_DeleteProductStatusForProductIdAndStatus: Must be called within a transaction', 16, 1)
return 0
end ............................

Although the SP is called iwithin transaction I am getting the above error

I actually want to know how @@transcount is managed in Hibernate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.