[CDBI] Multiple records
[prev]
[thread]
[next]
[Date index for 2005/09/06]
This is a multi-part message in MIME format.
--===============1440268455==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0097_01C5B276.D48024A0"
This is a multi-part message in MIME format.
------=_NextPart_000_0097_01C5B276.D48024A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have come across a tricky problem and would like advice for how to =
handle it best.
Let's suppose I have a Bucket which has_many Water::Drop's. Now, it's a =
really large bucket, and we may be able to put thousands of drops in it =
(or we might just put one). =20
It would be nice to be able to store them all at once. One-at-a-time =
method might be just a tad slow. =20
OK, so we make a create_many method in the parent class. Unlike the =
regular create() method it does not return any objects - it's for =
writing to the database and nothing else. Presumably, there is no need =
to generate thousands of objects at once - they can be retrieved later. =
There is a design problem with this approach: data validation routines =
are not being called. Triggers are not either. A lot of implied =
functionality breaks (some that I am probably not aware of).
I can certainly look at the code for Class::DBI::create() and make sure =
I do everything that's necessary. But before I plunge ahead, has anyone =
a) encountered this situation before b) thought of a clever way to solve =
it c) decided it's the wrong way to think about it d) has general =
advice.
Thanks for the help!
Cheers,
Kate
------=_NextPart_000_0097_01C5B276.D48024A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2722" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have come across a tricky problem and =
would like=20
advice for how to handle it best.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Let's suppose I have a Bucket which =
has_many=20
Water::Drop's. Now, it's a really large bucket, and we may be able =
to put=20
thousands of drops in it (or we might just put one). =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>It would be nice to be able to store =
them all at=20
once. One-at-a-time method might be just a tad slow. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>OK, so we make a create_many method in =
the parent=20
class. Unlike the regular create() method it does not return any =
objects -=20
it's for writing to the database and nothing else. Presumably, =
there is no=20
need to generate thousands of objects at once - they can be retrieved=20
later. There is a design problem with this approach: data =
validation=20
routines are not being called. Triggers are not either. A =
lot of=20
implied functionality breaks (some that I am probably not aware=20
of).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I can certainly look at the code for=20
Class::DBI::create() and make sure I do everything that's =
necessary. But=20
before I plunge ahead, has anyone a) encountered this situation before =
b)=20
thought of a clever way to solve it c) decided it's the wrong way to =
think about=20
it d) has general advice.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for the help!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Kate</FONT></DIV></BODY></HTML>
------=_NextPart_000_0097_01C5B276.D48024A0--
--===============1440268455==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
--===============1440268455==--
|
(message missing)
|
|
|
[CDBI] Multiple records
Kate Yoak 07:06 on 06 Sep 2005
|