Re: [CDBI] Re: Apps using Class::DBI

Matt S Trout <dbix-class-uY5y5/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Perrin Harkins wrote:
>> One thing DBIC does is handle nested transactions.
> 
> Are you talking about real (database level) nested transactions, or just
> avoiding calling commit inside of a sub that's been called from inside a
> transaction?  I haven't needed either, so far, but my local() approach
> provides a similar benefit, i.e. AutoCommit goes back to what it was
> when you entered the block, and if it was already off it stays off and
> no commit is sent.  There would be an issue if I wanted to call commit
> explicitly though, instead of letting it be called automatically when I
> pop out of the block.

Apparent nested transactions. The DBIC behaviour is largely the same as Tangram's.

>> The do_begin, do_rollback,
>> and do_commit methods just checks a nested level to handle the nested
>> transactions.
> 
> And they just decide whether or not to really call commit?  That would
> be useful, if you prefer begin_work/commit to the AutoCommit approach.
> I don't see these methods in DBIx::Class though.  Maybe they changed
> names since you wrote this code?

http://search.cpan.org/~mstrout/DBIx-Class-0.06000/lib/DBIx/Class/Schema.pm#txn_begin

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.