Grokbase
Topics Posts Groups | in
x
[ help ]

Edward J. Sabol (s...@alderaan.gsfc.nasa.gov)

Profile | Posts (26)

User Information

Display Name:Edward J. Sabol
Partial Email Address:s...@alderaan.gsfc.nasa.gov
Posts:
26 total
25 in Class::DBI
1 in mod_perl

5 Most Recent

All Posts
1) Edward J. Sabol [CDBI] Re: Was it deleted?
| +1 vote
Bill Moseley asked: You mean the number of rows affected by the SQL delete statement, right?...
Class::DBI
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Bill Moseley asked:
> Shouldn't this check the row count?

You mean the number of rows affected by the SQL delete statement, right?
Anyway, no, I don't think it should really, but that's just my opinion. You
might want to look into using transactions if you're worried about another
process deleting records that you're using....

_______________________________________________
ClassDBI mailing list
[email protected: Cla...@lists.digitalcraftsmen.net]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
2) Edward J. Sabol [CDBI] Re: construct sucks.
| +1 vote
If this problem (and any others that might crop up) were solved, however, it does seem like it...
Class::DBI
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Perrin Harkins wrote:
> The potential problem with this change (and I think this was actually
> discussed earlier on the list) is that somewhere else you may have
> already updated one of those keys and not saved it yet, so you'd be
> overwriting that update here. You could check to see if the keys have
> been changed before writing the new data to the object, although this
> will slow it down.

If this problem (and any others that might crop up) were solved, however, it
does seem like it could be a very useful addition, even with the extra
checking. More experimentation and a test case (if there isn't already one)
that properly touches on the potential problem cited by Perrin above are
needed.

_______________________________________________
ClassDBI mailing list
[email protected: Cla...@lists.digitalcraftsmen.net]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
3) Edward J. Sabol [CDBI] Re: Many-to-Many - why no CDBI::Relationship?
| +1 vote
Ryan Tate asked: My feeling is that they aren't, but I've done no real benchmarking, under load or...
Class::DBI
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Ryan Tate asked:
> I'm curious if you have any sense how this performs this under load. I
> want to go beyond CDBI's native many-to-many support because it
> requires an extra db query for each and every associated item you want
> to flesh out, as oppposed to one query for all items. But maybe these
> simple SQL queries aren't much of a load?

My feeling is that they aren't, but I've done no real benchmarking, under
load or otherwise. My applications just don't feel slow to me, so I've felt
no need to optimize this aspect. I suspect that other aspects (like network
I/O, HTML rendering time in the web browser, Perl object creation, etc.)
dominate the user experience. My CDBI classes and inter-class relationships
are not super-complicated though, and I'm not typically instantiating a ton
of objects usually. YMMV.

I can certainly think of occasions when I don't need to flesh out the related
objects because they are simply not utilized, so doing a join in those cases
seems superfluous.

> In my own benchmarks with my particular rdbms (the usual one, say what
> you will of it), a join always wins out over many simple connects.

I think that will vary depending on the RDBMS being used and the table schema
and size and indexing methodology, of course. I've certainly used a couple of
RDBMSes over the years which have had rather atrocious join performance under
any kind of load greater than zero, but perhaps that was only true back in
the Mesozoic Era and all modern RDBMS's have really good join performance
now.

_______________________________________________
ClassDBI mailing list
[email protected: Cla...@lists.digitalcraftsmen.net]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
4) Edward J. Sabol [CDBI] Re: Many-to-Many - why no CDBI::Relationship?
| +1 vote
FWIW, I don't use custom SQL or use CDBI::Sweet for my many-to-many relationships. I've always been...
Class::DBI
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
> Are most people happy writing custom SQL as needed? Or constructing
> the appropriate search query in Class::DBI::Sweet? As far as I can
> tell, Sweet can get many-to-many related objects with one query, but
> you have to construct the correct ->search.

FWIW, I don't use custom SQL or use CDBI::Sweet for my many-to-many
relationships. I've always been happy enough with the standard method for
defining many-to-many relationships in Class::DBI, as documented in the pod at
http://search.cpan.org/~tmtm/Class-DBI/lib/Class/DBI.pm#MANY_TO_MANY_RELATIONSHIPS

Would a HasManyToMany Relationship subclass be useful? Sure.

Aaron Trevena created the HasManyOrdered Relationship which claims to support
many-to-many relationships. I've never used it though. You might want to look
into that.

Later,
Ed

_______________________________________________
ClassDBI mailing list
[email protected: Cla...@lists.digitalcraftsmen.net]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
5) Edward J. Sabol [CDBI] Re: Statement handle warnings issue?
| +1 vote
I don't use MySQL personally, but, on 7/19/06, Dan Rowles <d.rowles@outcometechnologies.com> posted...
Class::DBI
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
John Day wrote:
> It seems that if I use a search, then when I go to do another search I
> get a warning like this:
>
> prepare_cached(SELECT id
> FROM   contact
> WHERE  user = ?
> ) statement handle DBIx::ContextualFetch::st=HASH(0x864c378) still
> Active at /usr/lib/perl5/site_perl/5.8.4/Ima/DBI.pm line 391
>
> DBIx::ContextualFetch is v 1.03
> DBD::mysql is v3.0006
> Ima::DBI is v0.33
> Class::DBI is v3.0.14
>
> any suggestions?

I don't use MySQL personally, but, on 7/19/06, Dan Rowles
<d.rowles@outcometechnologies.com> posted the following remedy to the
classdbi mailing list for this exact problem:

   Downgrading to DBD::mysql 3.0003 will make the problem go away for now.

Hope this helps,
Ed

_______________________________________________
ClassDBI mailing list
[email protected: Cla...@lists.digitalcraftsmen.net]
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

spacer
Profile | Posts (26)
Home > People > Edward J. Sabol