0
|
1 using System;
|
|
2 using System.Data;
|
|
3
|
|
4 using NUnit.Framework;
|
|
5
|
|
6 using BLToolkit.Data;
|
|
7
|
|
8 namespace HowTo.Data
|
|
9 {
|
|
10 [TestFixture]
|
|
11 public class Transaction
|
|
12 {
|
|
13 [Test]
|
|
14 public void Test1()
|
|
15 {
|
|
16 using (DbManager db = new DbManager())
|
|
17 {
|
|
18 db./*[a]*/BeginTransaction()/*[/a]*/;
|
|
19
|
|
20 // ...
|
|
21
|
|
22 db./*[a]*/CommitTransaction()/*[/a]*/;
|
|
23 }
|
|
24 }
|
|
25
|
|
26 [Test]
|
|
27 public void Test2()
|
|
28 {
|
|
29 using (DbManager db = new DbManager())
|
|
30 {
|
|
31 db.BeginTransaction(/*[a]*/IsolationLevel.ReadCommitted/*[/a]*/);
|
|
32
|
|
33 // ...
|
|
34
|
|
35 db.CommitTransaction();
|
|
36 }
|
|
37 }
|
|
38 }
|
|
39 }
|