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