[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limitation of Ozone -- Cant return an iterator



Falko:

Thanks for the help.  But, this leads me to another question:

What is the best way to return a collection of objects 
from the database?

For example, if I want to retrieve all objects with a given
attribute value.

Is it best to declare my own collection class that has
a proxy and then fill that collection and return the proxy
object for the collection.

It seems like then Ozone should have a library of collection
classes for operations like this.

They could really be wrappers around the Java collection
classes.

Thanks,
	Neil.


> In your code you are trying to manipulate the internal data of an database
> object via ordinary Java references. The hashmap iterator keeps a ordinary
> java reference to the hashmap to do its job. It knows nothing about ozone's
> persistent references (proxies). After the iterator is serialized thru the
> socket connection its references are no longer valid in the new VM.
> 
> Besides, java.util.HashMap$HashIterator is plain and simple not serializable.
> One could hardly tell this a limitation of ozone.

--
Neil Aggarwal
JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
Custom Internet Development -- Java, JSP, servlets, databases