tags:

views:

16

answers:

0

The documentation found at:

http://subsonicproject.com/active-record/transactions/

is wrong. The SharedDbConnectionScope should be within the TransactionScope. So it should look like:

using (TransactionScope ts = new TransactionScope()) {

using (SharedDbConnectionScope sharedConnectionScope = new SharedDbConnectionScope()) {
    Product p = new Product(1);
    p.Title = "new title";

    Product p2 = new Product(2);
    p.Title = "another new title";

    // ...
    p.Save();
    p2.Save();
    ts.Close();
}

}