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

Re: How to use a comparator?



Don:

Sorry that it took me so long to get back to you.  I 
caught the flu and this is the first chance that I had
to get back to the computer.

> Since the application is running in a client-server environment returning a
> TreeSet may raise some issues. For example, as I understand the scenario
> that you describe, the TreeSet object will exist on the client and changes
> to the set (i.e. set membership) will not be reflected on the server.

I retrieved the objects in a non-update method, which
used a read-only transaction on the server.  As I interpret
it, any modificaitons to the objects will not be updated
in the database in this scenario.  Is this correct?

 
> Perhaps if you could share something about the requirements that led to your
> design decision to return a TreeSet the issues can be resolved more readily.

Well, what I want to do is to have an ordering to my
objects.  They are added one-at-a-time to the database
and I wanted to retrieve a set of the ones added so far.

I want to keep them in order when I use them on the client.

> What is the cardinality of the sets? 

I dont understand this statement, please explain.

> Will the sets be updated? 
>Will  set member attributes involved in the sorting be updated? 

No, the set is just a way to step-thru all of the objects
in the database.


> How will the set be
> used? e.g. Values are displayed and members selected in a GUI.

Yes, this is exactly what I want to do.
If the person wants to update a member, I will have to call
an update method on the member object and then re-load the set from
the server since I read it out in a read-only transaction.

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