use namespace::clean;
__PACKAGE__->mk_group_accessors(simple => qw/
- _normal_storage
+ _normal_storage _easydbi
/);
my @proxy_to_normal_storage = qw/
still runs.) To keep your app responsive, I recommend avoiding long-running
queries.
-=head2 transactions
-
-Transactions are not currently supported at all.
-
=cut
# make a normal storage for proxying some methods
};
}
+sub _init {
+ my $self = shift;
+
+ my ($dsn, $user, $pass, $opts) = @{ $self->_dbi_connect_info };
+
+ $self->throw_exception(
+ 'coderef connect_info not supported by '.__PACKAGE__
+ ) if ref $dsn eq 'CODE';
+
+ my $easydbi = POE::Component::EasyDBI->new(
+ alias => '',
+ dsn => $dsn,
+ username => $user,
+ password => $pass,
+ options => $opts
+ );
+
+ $self->_easydbi($easydbi);
+}
+
+sub DESTROY {
+ my $self = shift;
+
+ if ($self->_easydbi) {
+ $self->_easydbi->shutdown;
+ }
+}
+
1;
=head1 AUTHOR
isnt $seq, '0,1,2,3,4,5', 'records were not inserted synchronously';
$_[HEAP]{creates_done_ran} = 1;
+
+ $_[KERNEL]->yield('cleanup');
+ },
+ cleanup => sub {
+ delete $_[HEAP]{schema}; # FIXME this should not be necessary
},
},
);