locked
Trouble with Transaction & OLEDB RRS feed

  • Question

  • I have the following code:

    Imports System.Transaction

    ...

    Using trScope = New TransactionScope

        Try

            Me.Repar1TableAdapter.Insert(xxx data)

            Me.Repar2TableAdapter.Insert(xxx data)

            Me.ReparObsTableAdapter.Insert(xxx data)

        Catch ex As Exception

            MsgBox("Error de Insert ...")

        End Try

        trScope.Complete()

        trScope.Dispose()

    End Using

    I have a conection to access database: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=R:\Reparaciones.mdb"

    I'm getting a exception on the first Insert:

      Message="El proveedor 'Microsoft.Jet.OLEDB.4.0' no admite la interfaz ITransactionLocal. Las transacciones locales no están disponibles con el proveedor actual."

      Message="The provider 'Microsoft.Jet.OLEDB.4.0' does not admite ITransactionLocal interface. The local transactions there are not available with the actual provider" (in english)

    What I'm doing wrong, or what I'm forgetting to do.

    Thank you.

    IlCapo

     

    Sunday, January 7, 2007 5:28 PM

Answers

  • System.Transaction namespace designed for the distributed transactions, not for the database one and I believe Access does not support distributed transactions. You need to use BegitTransaction method of the database connection to open database transaction against Access database

    Monday, January 8, 2007 11:25 AM
  • Yes the problem isn't with ITransactionLocal but with ITransactionJoin.

    Jet provider does not support ITransactionJoin, so it will not work with TransactionScope.  The error message here is wrong but the basic issue is Jet provider will not work with TransactionScope, you need to use manual transactions.

    Tuesday, January 16, 2007 10:30 PM

All replies

  • System.Transaction namespace designed for the distributed transactions, not for the database one and I believe Access does not support distributed transactions. You need to use BegitTransaction method of the database connection to open database transaction against Access database

    Monday, January 8, 2007 11:25 AM
  • Could you provide some additonal information about your insert code?  The Jet Oledb provider supports ITransactionLocal so there must be else going on.

     

    Monday, January 8, 2007 11:01 PM
  • I read that OLEDB & Access do not work with TransactionScope.

    Thank you.

    Saturday, January 13, 2007 4:11 PM
  • Jet provider supports ITransactionLocal, see:

    http://support.microsoft.com/kb/221071

    I'll try to repro.

    Tuesday, January 16, 2007 10:13 PM
  • Yes the problem isn't with ITransactionLocal but with ITransactionJoin.

    Jet provider does not support ITransactionJoin, so it will not work with TransactionScope.  The error message here is wrong but the basic issue is Jet provider will not work with TransactionScope, you need to use manual transactions.

    Tuesday, January 16, 2007 10:30 PM