on 2013 May 28 3:45 PM
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)
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.