Re: [RDBO] Transactions, ACID etc.

2007-03-21 Thread Jud
Thanks for this. - jud On 16/03/07 10:12 -0700, "Randal L. Schwartz" wrote: > > "Jud" == Jud <[EMAIL PROTECTED]> writes: > > Jud> Would either of you be willing to share your code? I'm looking to solve > Jud> a similar problem and would greatly appreciate it. > > The simplest version (wh

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Jonathan Vanasco
On Mar 16, 2007, at 1:12 PM, Randal L. Schwartz wrote: > package My::RDBO; > use base Rose::DB::Object; > use strict; > > sub init_db { > our $cached_db ||= do { > require My::RDB; # my Rose::DB subclass > My::RDB->new; > } > } > > 1; mine rel

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Randal L. Schwartz
> "Jud" == Jud <[EMAIL PROTECTED]> writes: Jud> Would either of you be willing to share your code? I'm looking to solve Jud> a similar problem and would greatly appreciate it. The simplest version (which I used until I had to deal with separate logins) is just: package My::RDBO; use

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Perrin Harkins
On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: > But doesn't that act of using a raw dbh from inside of a model, defeat > the purpose of models/MVC to begin with? Well, now you're getting into what MVC means and how it gets implemented by systems like Catalyst. I think the "controller

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Jud
On 16/03/07 12:13 -0400, Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > > On Mar 16, 2007, at 11:54 AM, Randal L. Schwartz wrote: > > > In my application, I've overridden init_db so that the *same* DB is > > returned > > for my entire application, regardless of the individual row class > > or

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Jonathan Vanasco
On Mar 16, 2007, at 11:54 AM, Randal L. Schwartz wrote: > In my application, I've overridden init_db so that the *same* DB is > returned > for my entire application, regardless of the individual row class > or manager. FWIW, i did a similar thing -- except I have it requesting a read- only

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Randal L. Schwartz
> "Perrin" == Perrin Harkins <[EMAIL PROTECTED]> writes: Perrin> I assume you're talking about the faked multiple levels of commit that Perrin> DBIx::Class provides.The simplest answer is to just stay away from Perrin> all that stuff. Do the commits yourself, at the highest level. Keep P

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Jonathan Vanasco
On Mar 16, 2007, at 10:41 AM, Christopher H. Laco wrote: > I don't disagree with you at all. It just seems like with all of the > ORMS out there and all of the ways to use 'schema classes' from them, > doing transactions in levels (or multiple levels above) is clumsy > at best. no, that makes

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Christopher H. Laco
I guess I'm just spoiled by other languages sometimes. A certain MS Java ripoff language can do transactions over an entire 'app domain'. So any db call, to any db, multiple dbs, and file actions, or anything that "supports transactions" act as part of one global transaction automatically, without

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Christopher H. Laco
Perrin Harkins wrote: > On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: >> So, I have my Cat models all >> provide commit() and rollback(). > > I wouldn't do that. This is a function of your database connection, > not of individual row objects. DBI already provides commit/rollback, >

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Perrin Harkins
On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: > So, I have my Cat models all > provide commit() and rollback(). I wouldn't do that. This is a function of your database connection, not of individual row objects. DBI already provides commit/rollback, and that's the level where it shou

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Christopher H. Laco
Perrin Harkins wrote: > On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: >> 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. > > So you're saying tha

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Perrin Harkins
On 3/16/07, Christopher H. Laco <[EMAIL PROTECTED]> wrote: > 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. So you're saying that one of your tools is trying t

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Christopher H. Laco
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

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Perrin Harkins
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.

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Christopher H. Laco
Perrin Harkins wrote: > On 3/16/07, James Masters <[EMAIL PROTECTED]> wrote: >> Just wondering - does Rose deal with transactions, rollbacks etc. "under the >> hood" (or "under the bonnet" as we say in England) and is therefore ACID >> compliant? > > You really don't need any help from your object

Re: [RDBO] Transactions, ACID etc.

2007-03-16 Thread Perrin Harkins
On 3/16/07, James Masters <[EMAIL PROTECTED]> wrote: > Just wondering - does Rose deal with transactions, rollbacks etc. "under the > hood" (or "under the bonnet" as we say in England) and is therefore ACID > compliant? You really don't need any help from your object-relational mapper to use trans

[RDBO] Transactions, ACID etc.

2007-03-16 Thread James Masters
Just wondering - does Rose deal with transactions, rollbacks etc. "under the hood" (or "under the bonnet" as we say in England) and is therefore ACID compliant? I realise that this will depend upon the capabilities of the underlying database Unfortunately, all my tables are MyISAM but am wond