I misread your statement - you are looking at collections coming back from the query, not object referenced collections. In this case the proxy-prefetch limit won't help you, however passing the lazy loading collection as the return value from whatever your query/repository/etc service is should do that for you =)

Hmm, you have me thinking. May have to implement this, though I doubt it would be useful enough to get included in commons-collections (and at their release rate of once every year or two, and 3.0 being due out any-day-now, it wouldn't be very helpful in the short term to ask them to include it anyway). Could hide it in with the convenience collections in OJB maybe, if it seems like it will be widely useful.

-Brian

On Jan 20, 2004, at 1:28 PM, Brian McCallister wrote:

If you are worried about the memory usage one thing you might want to consider is the paging support for collections. Specify to use a proxy for the collection, then set the proxy-prefetch-limit for the collection to the value you need (iirc, the default is either 50 or 200). It will only materialize object in hunks up to the proxy-prefetch-limit value.

Another possibility would be to use a lazy-loading collection implementation that takes an iterator as a constructor and doesn't traverse until it needs to. If the first and only call against it is to Collection#iterator and it returns a wrapper around the initial iterator you can get the same behavior.

If this is all you need it for you could only implement this collection wrapper and throw UnsupportedOperationExceptions for all other operations (is it bad if I have "throw new UnsupportedOperationException("");" as a live template in IDEA? ;-).

-Brian


On Jan 20, 2004, at 12:49 PM, mirko wrote:


Antonio Gallardo wrote:

mirko dijo:
I forgot to ask: if I return a query results' iterator
(broker.getIteratorByQuery(query)), will I be able to pass it as a
parameter to flows's view and then iterate it in my JXTemplate? I've a
feeling that it won't work :(
The iterator no, but a bean collection yes. We use OJB to develop DB
application with flow+woody and jxtemplate and this is a paradise compared
with other approach.

Yes, I know I can pass collection of objects. But I'm afraid of memory usage if the collections are huge. :) But I think I'll do as you said, in the future maybe a iterator will be able to be passed :)


BTW Flow is the best new thing in Cocoon and the Woody becoming second one. If I only get OJB (or other) working with it I will be very happy.

What else can you ask? ;-)

OK, but off topic :) A question about encoding in JXTransfomer: If I pass a string with national characters (ISO-8869-2) from flow to the view (JXTemplate) these characters do not show up correctly. Is there any issues?


Regards,
mirek



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to