>I often need to iterate through a Collection and was wondering if its better
>to return the collection the client, which is by default serializable or
>would it make more sense to wrap the collection such that you can iterate
>through it remotely?  I would like to know what experiences people have had
>with either or another approach that might be preferable.  Any pros or cons
>to either approach?

I tend to use a session bean to return a structure (usually an array)
back to the client if I only want the data for read-only use (I'm doing
servlets so there's not much point in the overhead of the frequent
database calls to populate a list).

Iterating through the list remotely will generate a huge amount of network
traffic, depending on the system set up ...

>Along the same lines finder methods of entity beans return enumerations.  I
>have read in the archieves of this list that holding that storing this enum
>has a negative impact on the server in terms of resource consumption.  Is
>this true? In a situation where a finder method return 50-100 records, I
>might not want to send all of them to the client.  Would it not be
>reasonable to store the enum in a session object,  get the block of records
>you want and return those as a small collection (remotely or serializing
>what ever is the recommendation from above).  Is there a better way to
>handle this?

If you don't want to send all of them to the client then make the
finder more usefull, like taking in a parameter to use in the
where clause of the query string. But as I said above if you only
want the data for a read-only situation (select list, display, etc)
then just returning them in an array/vector/collection is fine.

Well, that's what I do anyway ...


--
Subvert the dominant paradigm
 http://www.cyber4.org/members/grumpy/index.html

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to