Re: [RDBO] on the fly fields

2007-06-27 Thread James Masters
I'm sorry; I made a mistake. More experimenting based on JohnS comments and it seems to be all working fine now - exactly as described but without having to create a dummy column. I'm not sure what my mistake was but it is working now. So no lazy or nonlazy parameters required and this is a good

Re: [RDBO] unblessed reference due to relationship name clash with existing class

2007-06-27 Thread John Siracusa
I don't think I understand your original post either. You said: > The relationship in the following seems to create a class > __PACKAGE__.'::Distribution' > which clashes with my class of the same name. A relationship definition doesn't "create" a class. An RDBO-derived class of the specified

Re: [RDBO] unblessed reference due to relationship name clash with existing class

2007-06-27 Thread Randal L. Schwartz
> "Philip" == Philip Dye <[EMAIL PROTECTED]> writes: Philip> Randal - I believe you misread my original message. No Philip> class referenced begins with 'Rose::DB'. Philip> Rather, it appears that '::' is appended Philip> to the name of the current class. Even if you use: class_pref

Re: [RDBO] unblessed reference due to relationship name clash with existing class

2007-06-27 Thread Philip Dye
Randal - I believe you misread my original message. No class referenced begins with 'Rose::DB'. Rather, it appears that '::' is appended to the name of the current class. So in class X with a child class 'X::Y', if one names a relationship 'Y', a name clash occurs. Frankly, I haven't delved de

Re: [RDBO] How to get transactions right

2007-06-27 Thread John Siracusa
On 6/27/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote: > I still don't understand why this is safe (I would like it to be, of course) > Think of this scenario (all with a mod_perl app with many users): User one > submits a form that does two loosely related write operations (no RDBO > sub-objects)

Re: [RDBO] odd behavior due to typo in primary key

2007-06-27 Thread John Siracusa
On 6/27/07, Philip Dye <[EMAIL PROTECTED]> wrote: > Should not Rose::DB::Object complain at some point during > setup or perhaps on first use of the class when a listed > primary key column is missing from the list of columns ? I have a check for this in Metadata.pm: foreach my $name ($self->pr

Re: [RDBO] How to get transactions right

2007-06-27 Thread Michael Lackhoff
On 27 Jun 2007 at 9:45, John Siracusa wrote: > > And if it works in principle do I have to stuff the $dbh manually into every > > RDBO object or does it "just work" because Apache::DBI takes care that RDBO > > gets the right (perhaps reused) handle even if RDBO always requests a fresh > > one? >

[RDBO] odd behavior due to typo in primary key

2007-06-27 Thread Philip Dye
A typo in the name of one primary key column is silently ignored even though no such column exists in the list of table columns. The impact: When given a set of columns which are children of another object via a one-to-many relationship, only only one element is inserted. After being inser

Re: [RDBO] How to get transactions right

2007-06-27 Thread John Siracusa
On 6/27/07, Michael Lackhoff <[EMAIL PROTECTED]> wrote: > It is a web app with lots of database activity (read and write). So > performance and data integrity is an issue and my idea is to use Apache::DBI > with autocommit => 0. FWIW, I take the opposite approach: AutoCommit is on, and I explicitl

Re: [RDBO] on the fly fields

2007-06-27 Thread John Siracusa
On 6/27/07, James Masters <[EMAIL PROTECTED]> wrote: > Unfortunately, doing this seems to remove the onthefly column from the > select spec completely. You can pass a nonlazy => 1 param to change that. > Also, I had trouble testing this properly but I think that even if lazy, > when I do include

Re: [RDBO] unblessed reference due to relationship name clash with existing class

2007-06-27 Thread Randal L. Schwartz
> "Philip" == Philip Dye <[EMAIL PROTECTED]> writes: Philip> This is probably well documented somewhere but I wasn't aware of it after Philip> using Rose::DB for over a year so others may find this useful. The easy solution is to have a reserved prefix for all Rose::DB subclasses and Rose::D

Re: [RDBO] How to get transactions right

2007-06-27 Thread Michael Lackhoff
David, > > If yes, my question is, how all the RDBO internals work with such a setup. > > If I remember correctly > > RDBO wraps complex saves or deletes within a transaction. Would this lead > > to something like > > nested transactions? Is this possible at all, with sqlite (I am using now)

[RDBO] unblessed reference due to relationship name clash with existing class

2007-06-27 Thread Philip Dye
This is probably well documented somewhere but I wasn't aware of it after using Rose::DB for over a year so others may find this useful. Rose::DB::Object class name clash: The relationship in the following seems to create a class __PACKAGE__.'::Distribution' which clashes with my class of the

Re: [RDBO] on the fly fields

2007-06-27 Thread James Masters
Unfortunately, doing this seems to remove the onthefly column from the select spec completely. Also, I had trouble testing this properly but I think that even if lazy, when I do include the onthefly column in the select spec, it still complains that the field doesn't exist. > -Original Messag

Re: [RDBO] How to get transactions right

2007-06-27 Thread David Lloyd
Michael, > If yes, my question is, how all the RDBO internals work with such a setup. If > I remember correctly > RDBO wraps complex saves or deletes within a transaction. Would this lead to > something like > nested transactions? Is this possible at all, with sqlite (I am using now) > and p

[RDBO] How to get transactions right

2007-06-27 Thread Michael Lackhoff
Hello, I read quite a lot recently about Apache::DBI, transactions and the problems that might occur but I must say that I am more confused than before as to what this all means for my RDBO project. It is a web app with lots of database activity (read and write). So performance and data integ