1 package DBIx::Class::Storage::DBI::ADO;
6 use base 'DBIx::Class::Storage::DBI';
15 DBIx::Class::Storage::DBI::ADO - Support for L<DBD::ADO>
19 This class provides a mechanism for discovering and loading a sub-class
20 for a specific ADO backend, as well as some workarounds for L<DBD::ADO>. It
21 should be transparent to the user.
25 sub _rebless { shift->_determine_connector_driver('ADO') }
27 # cleanup some warnings from DBD::ADO
28 # RT#65563, not fixed as of DBD::ADO v2.98
32 my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
34 local $SIG{__WARN__} = sub {
36 unless $_[0] =~ m{^Missing argument in sprintf at \S+/ADO/GetInfo\.pm};
39 $self->next::method(@_);
42 # Monkeypatch out the horrible warnings during global destruction.
43 # A patch to DBD::ADO has been submitted as well, and it was fixed
45 # https://rt.cpan.org/Ticket/Display.html?id=65563
47 unless ($DBD::ADO::__DBIC_MONKEYPATCH_CHECKED__) {
50 unless (try { DBD::ADO->VERSION('2.99'); 1 }) {
51 no warnings 'redefine';
52 my $disconnect = *DBD::ADO::db::disconnect{CODE};
54 *DBD::ADO::db::disconnect = subname 'DBD::ADO::db::disconnect' => sub {
55 my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
56 local $SIG{__WARN__} = sub {
58 unless $_[0] =~ /Not a Win32::OLE object|uninitialized value/;
64 $DBD::ADO::__DBIC_MONKEYPATCH_CHECKED__ = 1;
68 # Here I was just experimenting with ADO cursor types, left in as a comment in
69 # case you want to as well. See the DBD::ADO docs.
71 # my ($self, $dbh, $sql) = @_;
73 # my $sth = $self->disable_sth_caching
74 # ? $dbh->prepare($sql, { CursorType => 'adOpenStatic' })
75 # : $dbh->prepare_cached($sql, { CursorType => 'adOpenStatic' }, 3);
77 # $self->throw_exception($dbh->errstr) if !$sth;
86 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
90 You may distribute this code under the same terms as Perl itself.