Bug 31197 - TransactionScope ignores timeout
Summary: TransactionScope ignores timeout
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: 4.0.0
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-17 12:08 UTC by Shay Rojansky
Modified: 2016-04-16 09:07 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Shay Rojansky 2015-06-17 12:08:29 UTC
mono's implementation of TransactionScope does not enforce the timeout, looking at the sources nothing is done with it whatsoever.

To reproduce:

using (var scope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(0, 0, 1)))
{
   using (var conn = new NpgsqlConnection(....))  // or some other database
   {
       conn.Open();
       var cmd = new NpgsqlCommand(@"INSERT INTO data (name) VALUES ('HELLO')", conn);
       cmd.ExecuteNonQuery(); // just some update
       System.Threading.Thread.Sleep(5000);
   }
   scope.Complete();
}

This code should fail with a timeout exception, but it does not.

Note You need to log in before you can comment on or make changes to this bug.