Perrin Harkins wrote:
> On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote:
>> Totally a side tangent, but when you start using your schema classes
>> from RDBO/DBIC/CDBI in things like Catalyst as Models, and maybe using
>> many of them at the same time in one transaction, that whole "Just use
>> the dbh" falls apart.
> 
> In what way?  Do some of these try to commit transactions for you?
> Class::DBI doesn't.
> 
>>   ## Some function way above DBI
>>   DBI::Transaction->start;
>>
>>   $rdboclass->delete(...);
>>   $otherdbiclass->add(...);
>>   $dbicclass->update(...);
>>
>>   DBI::Transaction->commit;
> 
> Still not getting it.  DBI supports this almost exactly.
> 
>> I just lothe having to dig into individual modules to get a dbh to do a
>> transaction, or even use helper methods.
> 
> Can't help you there.  If you want to talk to the database, you need a
> dbh.  This is where the incompatibilities that I'm aware of lie:
> sharing a dbh between multiple O/R mappers can get tricky because they
> each have different expectations about how it will be created and what
> the default settings are.
> 
> - Perrin
> 
> 

My point is, there's no sane way to do a big jumble of code in one DB
transaction without having to go code diving for a dbh to work against,
ala 'local $dbh->{AutoCommit} and such.

IMHO, transactions need to be usable in perl without having to touch a
dbh...somehow. DBI::Transaction is a start...but I still have to hand it
a dbh... which one?

If I'm working in a Catalyst app, and I need $c->model('DBModuleOne')
and $c->model('DBModuleTwo') to do some work, and both either commit or
rollback, I have to do module diving to get at each models dbh and write
mode transaction management code. If today DBModuleTwo is DBIC, and
tomorrow it's RDBO (both proviging the same API), then I need to go
around rewriting transaction code.

To that point, I think there needs to be some other way to work with DBI
transactions without have to know how, or where to get those model
classes dbh handles. That's my beef. Transaction wrappers in that
situation just plain suck.

-=Chris


Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to