jensiator wrote: > Hello Edmund. > Nice to have someone in the same timezone! > Thanks for your reply. I'll try to set the modelobject member in the LDM to > transient and see if it solves the serializing exception(even if you don't > recommend it). Just want to try it out. > > If I understand you correctly you only keep a serialized identifier as a > member in the subclass of the LDM and then use the load method to populate > the modelobject. Have you been working with the SortableDataProvider? > Because I still have not figured out how one should combine the above > discussed LDM load method with the iterator method in the SDP. Do you call > the database in the LDM load method to get the data for the model. If so, do > you also call the database in the SDP.iterator method to get the data > collection for the current page? Because it seems to me that in that case > I'm getting the modelobject data twice from the database. > > Jens Alenius >
There should be no need to load the object twice from the DB for one request. You either fetch it using the SDP (and then construct a new LDM for each object) or you use the LDM to retrieve a single object (or LDMs for several select objects). Either way, I don't know of a case where you would want to fetch the object both ways for handling one and the same request. So, both the LDM load and the SDP iterator methods commonly fetch the object(s) from the DB, but you should not use both of them for handling any one given request (not for the same object, I mean). You can call the getObject() method of a newly instantiated LDM as many times as you like during one request without causing it to retrieve the object from the database, IF you passed that object to its constructor. Cheers Edmund -- Liland ...does IT better Liland IT GmbH Software Architekt email: [EMAIL PROTECTED] office: +43 (0)463 220-111 | fax: +43 (0)463 220-288 http://www.Liland.at --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
