I am using SqlAnywhere 11.0.1.28374 with Code First Entity Framework 4.2. I'm having a problem with the following code: System.Transactions.CommittableTransaction tx = new CommittableTransaction(); Transaction.Current = tx; MyDbContext context = new MyDbContext(connStr); //Constructor builds SAConnection from connStr ObjectContext oc = ((IObjectContextAdapter)context).ObjectContext; oc.Connection.Open(); The last line produces the error, "Cannot enlist in a transaction with uncommitted data." But as you can see, there have been no data changes on the connection yet. Is this a bug? Is there some other way to enlist in an ambient transaction? (btw, TransactionScope behaves the same way) |
Turned out to be a problem in a login_procedure. I added a commit at the end of the login_procedure, and now everything works beautifully. |