From: Rafael Kitover Date: Wed, 10 Feb 2010 12:42:17 +0000 (+0000) Subject: turn on ib_softcommit, savepoint tests now pass for DBD::InterBase X-Git-Tag: v0.08121~73^2~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a499b173840b72f8e6d32cc1935017daab8826f5;p=dbsrgits%2FDBIx-Class.git turn on ib_softcommit, savepoint tests now pass for DBD::InterBase --- diff --git a/lib/DBIx/Class/Storage/DBI/InterBase.pm b/lib/DBIx/Class/Storage/DBI/InterBase.pm index 2908519..5f9e799 100644 --- a/lib/DBIx/Class/Storage/DBI/InterBase.pm +++ b/lib/DBIx/Class/Storage/DBI/InterBase.pm @@ -163,6 +163,15 @@ sub _set_sql_dialect { } } +# softcommit makes savepoints work +sub _run_connection_actions { + my $self = shift; + + $self->_dbh->{ib_softcommit} = 1; + + $self->next::method(@_); +} + =head2 connect_call_datetime_setup Used as: diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm index 16f0ec9..11af658 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm @@ -47,9 +47,15 @@ sub _set_sql_dialect { 1 } =head1 CAVEATS +=over 4 + +=item * + This driver (unlike L) does not currently support reading or writing C values with sub-second precision. +=back + =head1 AUTHOR See L and L. diff --git a/t/750firebird.t b/t/750firebird.t index 981da1e..49f30c9 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -68,22 +68,22 @@ EOF ok($new->artistid, "Auto-PK worked"); # test savepoints -# eval { -# $schema->txn_do(sub { -# eval { -# $schema->txn_do(sub { -# $ars->create({ name => 'in_savepoint' }); -# die "rolling back savepoint"; -# }); -# }; -# ok ((not $ars->search({ name => 'in_savepoint' })->first), -# 'savepoint rolled back'); -# $ars->create({ name => 'in_outer_txn' }); -# die "rolling back outer txn"; -# }); -# }; -# ok ((not $ars->search({ name => 'in_outer_txn' })->first), -# 'outer txn rolled back'); + eval { + $schema->txn_do(sub { + eval { + $schema->txn_do(sub { + $ars->create({ name => 'in_savepoint' }); + die "rolling back savepoint"; + }); + }; + ok ((not $ars->search({ name => 'in_savepoint' })->first), + 'savepoint rolled back'); + $ars->create({ name => 'in_outer_txn' }); + die "rolling back outer txn"; + }); + }; + ok ((not $ars->search({ name => 'in_outer_txn' })->first), + 'outer txn rolled back'); # test explicit key spec $new = $ars->create ({ name => 'bar', artistid => 66 });