Skip to content

Commit

Permalink
[#616 status:resolved] Updated Data::ObjectDriver to v0.08.
Browse files Browse the repository at this point in the history
  • Loading branch information
tima committed Feb 1, 2011
1 parent bb0103b commit 88a1b1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
16 changes: 11 additions & 5 deletions extlib/Data/ObjectDriver.pm
Expand Up @@ -11,7 +11,7 @@ use Data::ObjectDriver::Iterator;

__PACKAGE__->mk_accessors(qw( pk_generator txn_active ));

our $VERSION = '0.07';
our $VERSION = '0.08';
our $DEBUG = $ENV{DOD_DEBUG} || 0;
our $PROFILE = $ENV{DOD_PROFILE} || 0;
our $PROFILER;
Expand Down Expand Up @@ -107,6 +107,7 @@ sub debug {
sub profiler {
my $driver = shift;
my ($sql) = @_;
local $@;
$PROFILER ||= eval {
require Data::ObjectDriver::Profiler;
Data::ObjectDriver::Profiler->new;
Expand Down Expand Up @@ -609,6 +610,14 @@ I<Data::ObjectDriver::Profiler> instance:
Then see the documentation for I<Data::ObjectDriver::Profiler> to see the
methods on that class.
In some applications there are phases of execution in which no I/O
operations should occur, but sometimes it's difficult to tell when,
where, or if those I/O operations are happening. One approach to
surfacing these situations is to set, either globally or locally,
the $Data::ObjectDriver::RESTRICT_IO flag. If set, this will tell
Data::ObjectDriver to die with some context rather than executing
network calls for data.
=head1 TRANSACTIONS
Expand Down Expand Up @@ -781,12 +790,9 @@ reporting bugs.
L<http://code.sixapart.com/>
Alternatively you can fork our git repositories. See the full list at:
http://github.com/sixapart
=head1 AUTHOR & COPYRIGHT
Except where otherwise noted, I<Data::ObjectDriver> is Copyright 2005-2010
Except where otherwise noted, I<Data::ObjectDriver> is Copyright 2005-2006
Six Apart, cpan@sixapart.com. All rights reserved.
=cut
4 changes: 4 additions & 0 deletions extlib/Data/ObjectDriver/Driver/Cache/Memcached.pm
Expand Up @@ -35,6 +35,10 @@ for my $driver_method (keys %memc_method_for) {
my $ret = $driver->cache->$memc_method(@_);
$driver->end_query(undef);

if ($Data::ObjectDriver::RESTRICT_IO) {
die "Attempted MemCached I/O while in restricted mode: $memc_method";
}

return if !defined $ret;
return $ret;
};
Expand Down
4 changes: 4 additions & 0 deletions extlib/Data/ObjectDriver/Driver/GearmanDBI.pm
Expand Up @@ -26,6 +26,10 @@ sub search {
my $driver = shift;
my($class, $terms, $args) = @_;

if ($Data::ObjectDriver::RESTRICT_IO) {
die "Attempted GearmanDBI I/O while in restricted mode: search() " . Dumper($terms, $args);
}

my $dbi = $driver->dbi;

## if Gearman shouldn't be used, fallback to the configured dbi driver
Expand Down

0 comments on commit 88a1b1c

Please sign in to comment.