none
Entity Framework 6 Disable Transactions on calls to ODBC Database that doesn't support transactions RRS feed

  • Question

  • I have a system I am working that is connected to a COBOL database. The COBOL database is exposed by Lient's Relativity Client and it does not support transactions.

    One the SQL Server side, we have an ODBC64 System DSN, and then in the SQL Server I create a LINKED Server.  Then in my database I am creating SYNONOMS to add the tables to my local database.

    I am using Entity Framework 6 and I have the models all created (had to create a SQL version of the database, create the models using Code First/Database Exists and then point the connection string to the "real" database.

    The problem is that when I attempt to create, update, or delete a record, Entity Framework does it as a transaction, which under normal conditions I would be perfectly fine with, but in this case the call fails because the ODBC client does not support transactions.

    Is there a way to alter this behavior in Entity Framework???

    Thanks in advance for any answers.

    • Moved by Kristin Xie Thursday, December 24, 2015 2:44 AM move to better forum
    Wednesday, November 25, 2015 6:08 PM

Answers

  • ODBC is yesteryear technology,  and EF doesn't work with ODBC or support it. There is no ODBC provider for EF.

    Additionally, you can't turn it off.

    https://msdn.microsoft.com/en-us/data/dn456843.aspx?f=255&MSPPError=-2147217396

    <copied>

    In all versions of Entity Framework, whenever you execute SaveChanges() to insert, update or delete on the database the framework will wrap that operation in a transaction. This transaction lasts only long enough to execute the operation and then completes. When you execute another such operation a new transaction is started.

    <end>

    • Marked as answer by Srife Thursday, December 24, 2015 5:04 PM
    Wednesday, November 25, 2015 7:32 PM

All replies