__PACKAGE__->mk_group_accessors('simple' =>
qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts
_conn_pid _conn_tid transaction_depth _dbh_autocommit _on_connect_do
- _on_disconnect_do savepoints/
+ _on_disconnect_do _on_connect_do_store _on_disconnect_do_store
+ savepoints/
);
# the values for these accessors are picked out (and deleted) from
my ($self, $opt) = (shift, shift);
my $accessor = "_$opt";
+ my $store = "_${opt}_store";
return $self->$accessor if not @_;
my $val = shift;
- $self->throw_exception("The value of $opt cannot be 'undef'")
- unless defined $val;
+ if (not defined $val) {
+ $self->$accessor(undef);
+ $self->$store(undef);
+ return;
+ }
my @store;
$self->throw_exception("Invalid type for $opt ".ref($val));
}
- $self->$accessor(\@store);
+ $self->$store(\@store);
+ $self->$accessor($val);
}
=head2 dbh_do
if (my $connection_call = $self->on_disconnect_call) {
$self->_do_connection_actions(disconnect_call_ => $connection_call)
}
- if (my $connection_do = $self->_on_disconnect_do) {
+ if (my $connection_do = $self->_on_disconnect_do_store) {
$self->_do_connection_actions(disconnect_call_ => $connection_do)
}
if (my $connection_call = $self->on_connect_call) {
$self->_do_connection_actions(connect_call_ => $connection_call)
}
- if (my $connection_do = $self->_on_connect_do) {
+ if (my $connection_do = $self->_on_connect_do_store) {
$self->_do_connection_actions(connect_call_ => $connection_do)
}
}