- my $initial_sql = $self->get_initial_sql;
- $dbh->do($initial_sql) if $initial_sql;
-
- SL::DBConnect::Cache->store($dbh, @args);
+ if ($initial_sql) {
+ $dbh->do($initial_sql);
+ $dbh->commit if !$dbh->{AutoCommit};
+ }
+ SL::DBConnect::Cache->store($dbh, @args, $initial_sql);