proposed perform_transaction() method

2004-03-31 Thread Tim Bunce
sub perform_transaction { my ($dbh, $coderef, $allow_non_transaction) = @_; my $use_transaction = 1; my $orig_AutoCommit = $dbh-{AutoCommit}; if ($orig_AutoCommit) { unless (eval { $dbh-{AutoCommit} = 0; 1 }) {

Re: proposed perform_transaction() method

2004-03-31 Thread Dean Arnold
sub perform_transaction { my ($dbh, $coderef, $allow_non_transaction) = @_; my $use_transaction = 1; my $orig_AutoCommit = $dbh-{AutoCommit}; if ($orig_AutoCommit) { unless (eval { $dbh-{AutoCommit} = 0; 1 }) {

Re: proposed perform_transaction() method

2004-03-31 Thread Andrew Pimlott
On Wed, Mar 31, 2004 at 04:08:09PM +0100, Tim Bunce wrote: sub perform_transaction { my ($dbh, $coderef, $allow_non_transaction) = @_; I suggest not taking any (non-coderef) arguments after $coderef, because they can easily get lost visually:

Re: proposed perform_transaction() method

2004-03-31 Thread Dean Arnold
While it would be neat to have such a capability (ie, adding transaction monitor capability to DBI), in this present form, the docs will need to be very explicit about what its capabilities really are (Bold and UPPERCASE THE POD DESCRIPTION). OTOH, might a partial xaction monitor

Mark II (was: proposed perform_transaction() method)

2004-03-31 Thread Tim Bunce
Incorporating feedback (thanks) and other ideas: sub perform_transaction { ! my ($dbh, $attr, $coderef, @args) = @_; my $wantarray = wantarray; my $use_transaction = 1; my $orig_AutoCommit = $dbh-{AutoCommit}; if ($orig_AutoCommit)

Re: Mark II (was: proposed perform_transaction() method)

2004-03-31 Thread Jan-Pieter Cornet
On Wed, Mar 31, 2004 at 10:20:16PM +0100, Tim Bunce wrote: sub perform_transaction { ... } But as I tinker with it I wonder if it's a solution chasing a problem. Where, and how, and why, would it be used? Anyone got any realistic examples? Well, yes, but it's 350 lines

Re: Mark II (was: proposed perform_transaction() method)

2004-03-31 Thread David Wheeler
On Mar 31, 2004, at 1:20 PM, Tim Bunce wrote: + $attr-{OnCommit}-() if $attr-{OnCommit}-(); I think you meant: $attr-{OnCommit}-() if $attr-{OnCommit}; Regards, David