Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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)

asked 28 May '13, 14:45

EMurchieBeyma's gravatar image

EMurchieBeyma
1945816
accept rate: 75%


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.

permanent link

answered 30 May '13, 16:21

EMurchieBeyma's gravatar image

EMurchieBeyma
1945816
accept rate: 75%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×69
×59

question asked: 28 May '13, 14:45

question was seen: 3,280 times

last updated: 30 May '13, 16:21