Re: [Modeling-users] Lazy Relation Initialisation
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-06-19 12:17:42
|
Sebastien Bigaret <sbi...@us...> wrote: > Yannick Gingras <yan...@sa...> wrote: > > Hi,=20 > > As I understand (looking at my bandwidth monitor), to-many relations > > are lazily retrieved. > >=20 > > ex:=20 > > myBooks =3D meAsAnAuthor.getBooks() # does not fetch anything=20 > > for book in myBooks: # fetch a record from the DB each loop > > print book.getTitle() > >=20 > > Is there a way to have to fetch the complete meAsAnAuthor with all > > it's books once to avoid the connection latency of a fetch for each > > book ? >=20 > Could you be more specific? For example, by setting > MDL_ENABLE_DATABASE_LOGGING and reporting the fetch you see for each > loop? The framework normally fetches all the books when the array is > first accessed, and if you find an exception to this rule this is > definitely a bug. Here, accessing the array is first done when > iterating on it in the for statement. [...] Oh well, you're right, the framework misbehaves with py2.2 (my initial check was against py2.1) I have submitted bug item #757181 and will have a look at it. -- S=E9bastien. |