3

I have searched every where in google, LLBLGenPro forums, Oracle documentation, I have successfully executed underlying insert statement in oracle and it works. I don't know how to further debug this.

Here is my code that I use to update the LLBLGENPRO entity

    using (var adapter = new DataAccessAdapter(MyConnectionString))
    {
        adapter.SaveEntity(MyCustomEntityObject);
    }

The Error Message:

Test method MyTest123 threw exception: 
System.Data.OracleClient.OracleException: ORA-01453: SET TRANSACTION must be first statement of transaction

Stack Trace:

    at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, ref OciRowidDescriptor rowidDescriptor, ref ArrayList resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, ref OciRowidDescriptor rowidDescriptor)
   at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
   at System.Data.OracleClient.OracleTransaction..ctor(OracleConnection connection, IsolationLevel isolationLevel)
   at System.Data.OracleClient.OracleInternalConnection.BeginOracleTransaction(IsolationLevel il)
   at System.Data.OracleClient.OracleInternalConnection.BeginTransaction(IsolationLevel il)
   at System.Data.OracleClient.OracleConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   at System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateNewPhysicalTransaction()
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.StartTransaction(IsolationLevel isolationLevelToUse, String name)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave)
   at MyTest123() in MyTest123: line 289
dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200

2 Answers2

1

The only thing I can think of is that you might use System.Transactions around this code, other than that, it should work properly (and it does, we can't reproduce your error here).

Btw, it's more efficient to post llblgen pro questions on our forums so we can pick them up right away.

Frans Bouma
  • 8,259
  • 1
  • 27
  • 28
0

A few thoughts:

  • you are creating your entity before this code, so you don't have any database connection for that object. Some persistence patterns I've seen require a database connection first and you create the entity using the connection as your factory
  • some threads attribute this to trying to change database isolation level on a transaction. You should check the parameters for DataAccess to see if it has some isolation-level setting
  • how about issue a rollback on the connection before trying to persist your object?

Good luck!

Andrew Wolfe
  • 2,020
  • 19
  • 25