On Wed, May 19, 2004 at 09:40:41AM -0400, Geoffrey Young wrote:
>   my $dbh = DBI->connect('dbi:Oracle:HELM', 'user', 'password');
> 
> 
> 
>   local $dbh->{AutoCommit} = 0;
>   local $dbh->{PrintError} = 0;
>

One good use for local as if you just set the attribute the handle gets corrupted for 
its next usage. 

doing :- 
$dbh->{AutoCommit} = 0;
looks fine and works but because of the caching you end up with polution of the cached 
handle.

Some time ago I wrote a patch that worked around that very problem but local is a 
better solution as it prevents the problem from occuring in the first place.

Paddy

 

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to