1 package DBIx::Class::Storage::DBI::ADO;
6 use base 'DBIx::Class::Storage::DBI';
11 use DBIx::Class::_Util 'sigwarn_silencer';
16 DBIx::Class::Storage::DBI::ADO - Support for L<DBD::ADO>
20 This class provides a mechanism for discovering and loading a sub-class
21 for a specific ADO backend, as well as some workarounds for L<DBD::ADO>. It
22 should be transparent to the user.
26 sub _rebless { shift->_determine_connector_driver('ADO') }
28 # cleanup some warnings from DBD::ADO
29 # RT#65563, not fixed as of DBD::ADO v2.98
33 local $SIG{__WARN__} = sigwarn_silencer(
34 qr{^Missing argument in sprintf at \S+/ADO/GetInfo\.pm}
37 $self->next::method(@_);
40 # Monkeypatch out the horrible warnings during global destruction.
41 # A patch to DBD::ADO has been submitted as well, and it was fixed
43 # https://rt.cpan.org/Ticket/Display.html?id=65563
45 unless ($DBD::ADO::__DBIC_MONKEYPATCH_CHECKED__) {
48 unless (try { DBD::ADO->VERSION('2.99'); 1 }) {
49 no warnings 'redefine';
50 my $disconnect = *DBD::ADO::db::disconnect{CODE};
52 *DBD::ADO::db::disconnect = subname 'DBD::ADO::db::disconnect' => sub {
53 local $SIG{__WARN__} = sigwarn_silencer(
54 qr/Not a Win32::OLE object|uninitialized value/
60 $DBD::ADO::__DBIC_MONKEYPATCH_CHECKED__ = 1;
64 # Here I was just experimenting with ADO cursor types, left in as a comment in
65 # case you want to as well. See the DBD::ADO docs.
67 # my ($self, $dbh, $sql) = @_;
69 # my $sth = $self->disable_sth_caching
70 # ? $dbh->prepare($sql, { CursorType => 'adOpenStatic' })
71 # : $dbh->prepare_cached($sql, { CursorType => 'adOpenStatic' }, 3);
73 # $self->throw_exception($dbh->errstr) if !$sth;
78 =head1 FURTHER QUESTIONS?
80 Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
82 =head1 COPYRIGHT AND LICENSE
84 This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
85 by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
86 redistribute it and/or modify it under the same terms as the
87 L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.