make insert work as a nested transaction too
[dbsrgits/DBIx-Class.git] / t / 746sybase.t
index 7c9e56b..6d77b4e 100644 (file)
@@ -76,6 +76,9 @@ SQL
 # so we start unconnected
   $schema->storage->disconnect;
 
+# inserts happen in a txn, so we test txn nesting
+  $schema->txn_begin;
+
 # test primary key handling
   my $new = $schema->resultset('Artist')->create({ name => 'foo' });
   ok($new->artistid > 0, "Auto-PK worked");
@@ -88,6 +91,8 @@ SQL
     $seen_id{$new->artistid}++;
   }
 
+  $schema->txn_commit;
+
 # test simple count
   is ($schema->resultset('Artist')->count, 7, 'count(*) of whole table ok');