Re: Pattern for sharing a object within a thread?
Posted By:
Anonymous
Posted On:
Tuesday, November 27, 2001 01:11 AM
Sharing a single object without passing it around sounds like the singleton pattern for me. You might use the ThreadLocal class to make it thread specific.
Re: Pattern for sharing a object within a thread?
Posted By:
John_Austin
Posted On:
Monday, November 26, 2001 08:57 PM
This is not a pattern solution, but I think the usual approach is to create
this object as a private synchronized object inside your class that implements Runnable (and therefore runs on a thread).
This will allow a single thread access
to the object at any time.
Your question could be more precise as there is some ambiguity in my mind as to whether the DAO's are on a single thread or are they on other threads.