I was going to suggest looking at the weak references also.
But one thing they do not do for you is coordinate the
cache of objects in memory versus what is in the database.


You may want to consider using Java Data Objects (JDO),
which will not only take care of your persistence but will
also ensure you only have the object in the case once.
In fact, it will keep track of all this for you.
You don't even need to track which of the objects are already
in memory.
By the way, most JDO implementations make use of these
weak reference facilities.



On Sun, 01 Feb 2004 16:40:34 -0500 Phillip Rhodes <[EMAIL PROTECTED]> wrote:
To elaborate more on my previous response... you might actually
want to look at the entire java.lang.ref package, if you
haven't already. Quoting from the package description:


Provides reference-object classes, which support a limited degree of interaction with the garbage collector. A program may use a reference object to maintain a reference to some other object in such a way that the latter object may still be reclaimed by the collector. A program may also arrange to be notified some time after the collector has determined that the reachability of a given object has changed.

The API docs can be found here, if you're interested:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ref/package-summary.html

TTYL, HTH, IANAL, ETC.,

Phil

--
When the 1st Amendment no longer protects your voice.
And when the 4th Amendment no longer protects your privacy or your stuff.
Thank God we have the 2nd Amendment to tell our elected representatives that enough is enough.
It's time to put "... from my cold, dead hands" back where it belongs.


FREE AMERICA
Vote Libertarian
www.lp.org


_______________________________________________ Juglist mailing list [EMAIL PROTECTED] http://trijug.org/mailman/listinfo/juglist_trijug.org

-=-=-=-=-


_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to