Re: Transaction Wrapper and Perl 5.6.1
[prev]
[thread]
[next]
[Date index for 2004/09/08]
>>> I'm trying to implement a custom trasaction subroutine in my program and
>>> I found out that "local $class->db_Main->{AutoCommit};" inside of
>>> do_transaction() subroutine caused memory leaks with Perl 5.6.1 from
>>> www.class-dbi.com site.
>>
>> I'm kind of locked into Perl 5.6.1 myself. My solution is to add
>> AutoCommit => 1 to all of my Class::DBI connection attributes. If you're
>> always in AutoCommit mode, then you don't need to "local
>> $class->db_Main->{AutoCommit};" in the do_transaction() method (just comment
>> that line out) and you won't leak memory.
>
> Thanks for help, Edward,
> However, if I am always in AutoCommit mode, how trasaction is going to
> work?
> Is dbi_rollback and dbi_commit function sill working under AutoCommit mode?
> Thanks in advance..
I'm sorry. I meant to write "AutoCommit => 0" and "never in AutoCommit mode"
above. You'll have to explicitly commit everything, so, yes, dbi_rollback and
dbi_commit will work just fine in that scenario.