Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1307

TransactionPropagation.NotSupported should run with new TransactionScopeOption.Suppress


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.1
    • Component/s: Spring-NET-TX
    • Labels:
    • Environment:
      Windows, .Net 3.5.


      When using Transaction attributes with the TxScopeTransactionManager the option TransactionPropagation.NotSupported should start a new TransactionScope with ransactionScopeOption.Suppress.

      The problem I'm having is that some of my transactional unit tests call out to Microsoft.Jet.OLEDB.4.0 provider to talk with Excel files, these connections do not support ITransactionLocal.

      Despite annotating the methods with advice to run with TransactionPropagation.NotSupported I still get the following exception:

      System.InvalidOperationException: The ITransactionLocal interface is not supported by the 'Microsoft.Jet.OLEDB.4.0' provider. Local transactions are unavailable with the current provider.
      at System.Data.OleDb.OleDbConnectionInternal.EnlistTransactionInternal(Transaction transaction, Boolean forcedAutomatic)
      at System.Data.OleDb.OleDbConnection.Open()
      at Spring.Data.Support.ConnectionUtils.DoGetConnection(IDbProvider provider) in ConnectionUtils.cs: line 147
      at Spring.Data.Support.ConnectionUtils.GetConnectionTxPair(IDbProvider provider) in ConnectionUtils.cs: line 102
      Spring.Data.CannotGetAdoConnectionException: Could not get ADO.NET connection.
      at Spring.Data.Support.ConnectionUtils.GetConnectionTxPair(IDbProvider provider) in ConnectionUtils.cs: line 105
      at Spring.Data.Core.AdoAccessor.GetConnectionTxPair(IDbProvider provider) in l:\projects\spring-net\trunk\src\Spring\Spring.Data\Data\Core\AdoAccessor.cs: line 156
      at Spring.Data.Generic.AdoTemplate.Execute<T>(IDbCommandCallback`1 action) in AdoTemplate.cs: line 315
      at Spring.Data.Generic.AdoTemplate.QueryWithResultSetExtractor<T>(CommandType cmdType, String cmdText, IResultSetExtractor`1 resultSetExtractor) in AdoTemplate.cs: line 884
      at Spring.Data.Generic.AdoTemplate.QueryWithRowMapperDelegate<T>(CommandType cmdType, String cmdText, RowMapperDelegate`1 rowMapperDelegate) in AdoTemplate.cs: line 847
      at ExcelDao.SelectAllRows() in ExcelDao.cs: line 115

      Where ExcelDao is a Spring managed object and SelectAllRows is annotated with attribute [Transaction(TransactionPropagation.NotSupported)]

      If I wrap the call to AdoTemplate.QueryWithRowMapperDelegate with a new suppressed TransactionScope that this exception isn't thrown...

      using (new TransactionScope(TransactionScopeOption.Suppress))
      return AdoTemplate.QueryWithRowMapperDelegate(CommandType.Text, sql, mapper);




            • Assignee:
              mark.pollack Mark Pollack
              chillitom Tom Rathbone
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: