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