       async.series(actions)
     )
 
-exports.beginCommit = (test) ->
+exports.transactionCommit = (test) ->
   test.expect(8)
 
   tester = new Tester(test)
   tester.run([
     tester.createTable
-    tester.beginTransaction
+    tester.beginTransaction1
     tester.insert
     tester.commitTransaction
     tester.selectExpectOneRow
     tester.close
   ])
 
-exports.beginRollback = (test) ->
+exports.transactionRollback = (test) ->
   test.expect(7)
 
   tester = new Tester(test)
   tester.run([
     tester.createTable
-    tester.beginTransaction
+    tester.beginTransaction1
     tester.insert
     tester.rollbackTransaction
     tester.selectExpectZeroRows
     tester.close
   ])
+
+exports.nestedTransactionCommit = (test) ->
+  test.expect(11)
+
+  tester = new Tester(test)
+  tester.run([
+    tester.createTable
+    tester.beginTransaction1
+    tester.beginTransaction2
+    tester.insert
+    tester.commitTransaction
+    tester.commitTransaction
+    tester.selectExpectOneRow
+    tester.close
+  ])
+
+exports.nestedTransactionRollbackOuter = (test) ->
+  test.expect(10)
+
+  tester = new Tester(test)
+  tester.run([
+    tester.createTable
+    tester.beginTransaction1
+    tester.beginTransaction2
+    tester.insert
+    tester.commitTransaction
+    tester.rollbackTransaction
+    tester.selectExpectZeroRows
+    tester.close
+  ])
+
+exports.nestedTransactionInProcCommit = (test) ->
+  test.expect(9)
+
+  tester = new Tester(test)
+  tester.run([
+    tester.createTable
+    tester.createProc
+    tester.beginTransaction1
+    tester.execProc
+    tester.commitTransaction
+    tester.selectExpectOneRow
+    tester.close
+  ])
+
+exports.nestedTransactionInProcRollbackOuter = (test) ->
+  test.expect(8)
+
+  tester = new Tester(test)
+  tester.run([
+    tester.createTable
+    tester.createProc
+    tester.beginTransaction1
+    tester.execProc
+    tester.rollbackTransaction
+    tester.selectExpectZeroRows
+    tester.close
+  ])


    @connection.execSqlBatch(request)

  insert: (callback) =>
    request = new Request('insert into #temp (id) values(1)', (err) =>
      @test.ok(!err)

  selectExpectOneRow: (callback) =>
    @select(callback, 1)

  beginTransaction: (callback, transactionName) =>
    @connection.beginTransaction((err, transactionDescriptor) =>
      @test.ok(!err)
      @test.ok(transactionDescriptor)

      callback(err)
    , transactionName)

  beginTransaction1: (callback) =>
    @beginTransaction(callback, 'one')

  beginTransaction2: (callback) =>
    @beginTransaction(callback, 'two')

  commitTransaction: (callback) =>
    @connection.commitTransaction((err) =>
