views:

427

answers:

1

We currently use iBatis and nHibernate on the same website. Performing a save on a specific page causes the following error to be thrown:

System.Data.OracleClient.OracleException: ORA-01453: SET TRANSACTION must be first statement of transaction

Stack trace is displayed at the end of this question. This only happens on this one page (at least that we have seen.)

The code is pretty basic, calling BeginTransaction after verifying that there is not currently an active transaction. I am stumped and looking for ideas: 1. What might be causing the issue 2. How to debug / troubleshoot - (for example: is there any way to snoop at the commands being sent to Oracle via the System.Data.OracleClient?)

Thank you for any help.

System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +304553 System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) +990 System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) +431 System.Data.OracleClient.OracleCommand.ExecuteNonQuery() +115 System.Data.OracleClient.OracleTransaction..ctor(OracleConnection connection, IsolationLevel isolationLevel) +377 System.Data.OracleClient.OracleInternalConnection.BeginOracleTransaction(IsolationLevel il) +101 System.Data.OracleClient.OracleInternalConnection.BeginTransaction(IsolationLevel il) +4 System.Data.OracleClient.OracleConnection.BeginDbTransaction(IsolationLevel isolationLevel) +63 System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction(IsolationLevel isolationLevel) +10 NHibernate.Transaction.AdoTransaction.Begin(IsolationLevel isolationLevel) +176

A: 

Make sure to turn off autocommit. Also, there are some statements that can't be sent in a batch (e.g., DDL) - for those you'll either have to send them separately or use execute_sql

Arnshea