Suppress TransactionScope just for initial database connection.

327 views
Skip to first unread message

Nicholas Gamble

unread,
Oct 1, 2014, 7:07:57 AM10/1/14
to particula...@googlegroups.com
Hi,

I am just starting out with NServiceBus and am setting up a proof of concept so I can demo the functionality.  I have to access a database which is actually Ingres.  

When I open a session I have to run some SQL which sets up lockmodes and such.

The problem is that the Ingres dataproviders will not allow the command to be run in a multi-query transcation.  I assume that is because NSB has created a TransactionScope.

    While in a multi-query transaction, the only WHERE clause parameter of SET LOCKMODE that can be specified is TIMEOUT.

So I tried to wrap the sql execute in:

    using (var scope = new TransactionScope(TransactionScopeOption.Suppress))
    try
    {
        do ingres setup here
    }
    finally {scope.Complete;}


Which means the SQL runs just fine.  NSB continues to process the message successfully, but when it is done I get this.

2014-10-01 11:55:52.5391|INFO|NServiceBus.Unicast.Transport.TransportReceiver|Failed to process message
System.Transactions.TransactionAbortedException: The transaction has aborted.
   at System.Transactions.TransactionStatePromotedAborted.PromotedTransactionOutcome(InternalTransaction tx)
   at System.Transactions.TransactionStatePromotedEnded.EndCommit(InternalTransaction tx)
   at System.Transactions.CommittableTransaction.Commit()
   at System.Transactions.TransactionScope.InternalDispose()
   at System.Transactions.TransactionScope.Dispose()
   at NServiceBus.Transports.Msmq.MsmqDequeueStrategy.Action() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Transports\Msmq\MsmqDequeueStrategy.cs:line 240


So I assume I have broken the TransactionScope that NSB setup before I get to my code.

Does anyone have an idea what I can do?  Swapping databases is not an option though ;-)

Nicholas Gamble

unread,
Oct 2, 2014, 2:34:10 AM10/2/14
to particula...@googlegroups.com
Thanks for reading, but it seems the problem is down to the Ingres drivers. Sigh!

Kijana Woodard

unread,
Oct 2, 2014, 10:53:15 AM10/2/14
to particula...@googlegroups.com
Thanks for following up. I wasn't able to answer yesterday, but Suppress should have worked fine.

--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at http://groups.google.com/group/particularsoftware.
To view this discussion on the web visit https://groups.google.com/d/msgid/particularsoftware/a678a228-8ecb-49c9-a3cb-b1caf101672e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages