5 # add some rows inside a transaction and commit it
6 # XXX: Is storage->dbh the only way to get a dbh?
7 DBICTest->class("Artist")->txn_begin;
9 DBICTest->class("Artist")->create( {
11 name => "artist number $_",
14 DBICTest->class("Artist")->txn_commit;
15 my ($artist) = DBICTest->class("Artist")->find(15);
16 is($artist->name, 'artist number 15', "Commit ok");
18 # add some rows inside a transaction and roll it back
19 DBICTest->class("Artist")->txn_begin;
21 DBICTest->class("Artist")->create( {
23 name => "artist number $_",
26 DBICTest->class("Artist")->txn_rollback;
27 ($artist) = DBICTest->class("Artist")->search( artistid => 25 );
28 is($artist, undef, "Rollback ok");