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