Re: Savepoint support proposal

2005-03-07 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

  
> While I don't have any particular objections, doesn't
> Pg (and most other DBMSs supporting savepoints) have
> SQL syntax to implement them ? If so, isn't just
>
> $dbh->do()
>
> sufficient ?
  
Sure, but they also have syntax to implement BEGIN and ROLLBACK.
I see the savepoints as an extension of the same sort of
transaction processing the DBI dos there. Certainly, drivers are
welcome to implementit any way they want (including allowing
savepoints via "do") but the advantages include being able to
track the savepoints closely, even allowing things like returning
an array of the current savepoints to the application. It also
abstracts the savepoint manipulation away from knowing the exact
SQL for your particular DBMS, one of the goals of DBI after all. :)

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200503070020
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-BEGIN PGP SIGNATURE-

iD8DBQFCK+S/vJuQZxSWSsgRAsWoAKCpoHsJrjzd9z/tcUMiST1W3CRywgCeP3oy
7VN7ahnLVwVLCFU+PF/IXrI=
=KDYY
-END PGP SIGNATURE-




Re: patch for DBI 1.47

2005-03-07 Thread Tim Bunce
On Mon, Mar 07, 2005 at 01:24:43PM +0100, Jens Hinrichs wrote:
> Hallo,
> 
> in an older version of DBI (i think it was 1.43) there was an warning
> in line 1317.
> "Use of uninitialized value in concatencation (.) or string at..."
> 
> in the 1.47 Version the bug is fixed in an (for me) unclean way:
>
> my $key =  do{ local $^W; # silence undef warnings
> ...
> }

Counts as simple, effective, sufficient, and efficient in my book :)

Tim.


Re: Savepoint support proposal

2005-03-07 Thread Tim Bunce
On Sun, Mar 06, 2005 at 08:41:01PM -0800, Dean Arnold wrote:
> Greg Sabino Mullane wrote:
> >
> >We are working on implementing savepoint support in DBD::Pg, and
> >someone pointed out (quite rightly) that perhaps there should be
> >DBI method support for savepoints, as they are a standard SQL
> >construct used by more than just PostgreSQL. So I would like to
> >propose that DBI implement a savepoint, release, and rollbackto
> >method, similar to the existing begin, commit, and rollback
> >methods for database handles. In short, these would be simple
> >wrappers, with the actual implementation left to the DBDs. I can
> >whip up a prototype and more detailed docs, but wanted to see if
> >there was any input or objections before I did.
> >
> >Thanks,
> >- --
> >Greg Sabino Mullane [EMAIL PROTECTED]
> 
> While I don't have any particular objections, doesn't
> Pg (and most other DBMSs supporting savepoints) have
> SQL syntax to implement them ? If so, isn't just
> 
> $dbh->do()
> 
> sufficient ?
> 
> my 2 cents,

Mine too.

The only significant reason I can see for a specific API for savepoints
would be to support distributed transaction management (ala XA).
If that is the only significant reason then any API proposals should
be made in that context.

Tim.


patch for DBI 1.47

2005-03-07 Thread Jens Hinrichs
Hallo,
in an older version of DBI (i think it was 1.43) there was an warning
in line 1317.
"Use of uninitialized value in concatencation (.) or string at..."
in the 1.47 Version the bug is fixed in an (for me) unclean way:
my $key =  do{ local $^W; # silence undef warnings
...
}
if fixed that problem in another way with map.
I think it is the better way to do it.
my $key = join "~~", $dsn, $user||'', $auth||'', map { defined $_ ? $_ 
: '' } $attr ? ( @attr_keys, @[EMAIL PROTECTED] ) : ();

My patch is attached.
Regardz Jens Hinrichs



DBI_1.47_patched.diff
Description: Binary data