[Modeling-users] Lazy Initialization Part 2
Status: Abandoned
Brought to you by:
sbigaret
From: Yannick G. <yan...@sa...> - 2003-07-10 18:22:50
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,=20 I have a particular record set that hold 700 or so rows. I use dynamic i18n from another table that we will call i18nTable for simplicity. There is only a few fields in i18nTable : title and description. =20 The relation look like this :=20 <relation displayLabel=3D''=20 joinSemantic=3D'0'=20 name=3D'i18ns'=20 destinationEntity=3D'i18nTable'=20 multiplicityLowerBound=3D'0'=20 multiplicityUpperBound=3D'-1'=20 isClassProperty=3D'1'=20 deleteRule=3D'0'> <join sourceAttribute=3D'id' destinationAttribute=3D'masterId' /> </relation> So here I am trying to fetch my whole record set. The initial fetch is really fast but when I try to getI18ns() on each fetched object it result in a SQL SELECT. This mean that do 701 SELECTs where I intended to do only one... My whole fetch take 30 seconds to complete but the initial fetch (the master records with lots of columns) take barely a second. It would be really nice if I could group the fetch so that it resulted in a single SQL select (ok, maybe 2 : one for master records, one for all the i18ns). I understand why you really want lazy initialization. It's would be even slower to fetch all the database when you fetch an object with many relations. But having it optional, something like a recursiveFecth() would be really nice. So my question is : Is it possible to do so ? BTW The trick with FixedPoint works really well, tanks for the hints ! =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/Das2rhy5Fqn/MRARAiPuAJ9cBhJfvYBGSaSsnRLzMFSSLqMdyQCgh83G lE1qiL39SAG5tA2GV6bveG0=3D =3DpJz0 =2D----END PGP SIGNATURE----- |