X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC%2FFirebird.pm;h=d4a5f504b207b119a66d2e9c38275861ff1230f3;hb=726c8f65ef37b47aad62e29a306f64528a00f65d;hp=cb3687927db16e90c8a9aa28e6ea08a14a54c566;hpb=c58270743fa0bebf1410d02136b3f82ec8838feb;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm index cb36879..d4a5f50 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm @@ -2,15 +2,17 @@ package DBIx::Class::Storage::DBI::ODBC::Firebird; use strict; use warnings; -use base qw/DBIx::Class::Storage::DBI::InterBase/; +use base 'DBIx::Class::Storage::DBI::InterBase'; use mro 'c3'; +use Try::Tiny; +use namespace::clean; =head1 NAME DBIx::Class::Storage::DBI::ODBC::Firebird - Driver for using the Firebird RDBMS through ODBC -=head1 SYNOPSIS +=head1 DESCRIPTION Most functionality is provided by L, see that module for details. @@ -19,8 +21,15 @@ To build the ODBC driver for Firebird on Linux for unixODBC, see: L +This driver does not suffer from the nested statement handles across commits +issue that the L based +driver does. This makes it more suitable for long running processes such as +under L. + =cut +__PACKAGE__->datetime_parser_type ('DBIx::Class::Storage::DBI::ODBC::Firebird::DateTime::Format'); + # XXX seemingly no equivalent to ib_time_all from DBD::InterBase via ODBC sub connect_call_datetime_setup { 1 } @@ -30,11 +39,21 @@ sub _init { 1 } # ODBC uses dialect 3 by default, good sub _set_sql_dialect { 1 } -# releasing savepoints doesn't work, but that shouldn't matter +# releasing savepoints doesn't work for some reason, but that shouldn't matter sub _svp_release { 1 } -sub datetime_parser_type { - 'DBIx::Class::Storage::DBI::ODBC::Firebird::DateTime::Format' +sub _svp_rollback { + my ($self, $name) = @_; + + try { + $self->_dbh->do("ROLLBACK TO SAVEPOINT $name") + } + catch { + # Firebird ODBC driver bug, ignore + if (not /Unable to fetch information about the error/) { + $self->throw_exception($_); + } + }; } package # hide from PAUSE @@ -88,3 +107,4 @@ See L and L. You may distribute this code under the same terms as Perl itself. =cut +# vim:sts=2 sw=2: