> From: Peter Royal [mailto:[EMAIL PROTECTED]] > > On Monday 22 July 2002 02:02 pm, Berin Loritsch wrote: > > > I have some components that can be used for a SAX > pipeline, and thus > > > the components aren't threadsafe. I decided for a factory vs > > > pooling because the > > > program only needs one component every 24hrs, since it is > > > part of an EDI > > > interface. A pool seemed like a waste of resources. > > > > In Fortress, it can be changed to PerThreadComponentHandler very > > easily. The PerThreadComponentHandler uses lazy > initialization, but > > ensures there is no more than one instance of the component > per thread > > of execution. If your thread that used the component dies, the > > component will be removed from use. If there are no more requests, > > there are no more instances. > > I have no guarantees on which thread will be running the code > though. Its > scheduled to run via phoenix's TimeScheduler which pulls from > a ThreadPool, > so the EDI could be running via a separate thread each time.. > thus the # of > components could grow the be equal the # of threads in the > pool.. yada yada > :)
Granted. However, there is also no guarantee that the original thread will still exist when you are on a 24 hour basis. Besides, the level of resources we are talking about at this level is very minimal. In fact, you could probably get away with making this particular component a "singleton" or Threadsafe. How many threads are going to be accessing it simultaneously? -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>