5

We're trying to implement a quick prototype to prove something is possible with the Entity Framework...

We have an Informix DB that doesn't support transactions - is it possible to use the Entity Framework with this?

We have a working model, and the working providers, but it doesn't seem we can execute a CRUD query without transactions kicking in - we've even tried to surpress them...

[Test]
public void TestMethod1()
{
    entities ent = new entities();

    var a = ent.brands.Select(x => x);

    using (TransactionScope trans = new TransactionScope(
                                          TransactionScopeOption.Suppress))
    {
         ent.brands.AddObject(new brand() { br_name = "New Test Brand" });
         ent.SaveChanges();
    }
}

The error we're getting is below:

An error occurred while starting a transaction on the provider connection. See the inner exception for details.

I've looked around, and whats suggested is to use the suppression, but it doesn't seem to work... any ideas?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Stuart.Sklinar
  • 3,683
  • 4
  • 35
  • 89
  • And what is the inner exception? – nemesv Feb 15 '12 at 17:43
  • "We have an Informix DB that doesn't support transactions" - but IIRC even Informix 7 supports (non-nested) transactions - ? I suspect it's up to the driver to obey the supress flag, so this may be a bug with the IBM Data Provider. – Rup Feb 15 '12 at 18:33

1 Answers1

3

To answer your main question (I know nothing about Informix) - you cannot supress transaction. If SaveChanges doesn't find existing transaction it will always start a new one on the provider. It is key feature of EF to run SaveChanges in transaction.

Btw. I checked IBM Data Provider and I found only support for EFv1 so features from EFv4 and EFv4.1 don't have to work (unless there is some newer version of the provider).

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670