On 16-05-2008 at 12:27, Chris Cheshire wrote: > In my application context, I have set up some caches of global > information loaded from the database and stored in lists and maps. > Should I be synchronizing the creation and access to these collections > through the use of the java Collections.synchronizedX methods and > synchronized blocks when adding/removing from these caches?
Ideally, access should go through a synchronized cache object. I usually don't if the initialization is once (at startup), but otherwise such synchronization ensures the updates to the collections are atomic. Note however, that simply synchronizing the collections is not sufficient if the information in the collections has dependencies. > Does the stripes dispatcher create new threads for each new request to > an action? No, but the application server does (slight difference, but it amounts to the same thing). The action beans themselves may be reused, but not in two simultanious threads (due to the input being set in properties). This doesn't happen AFAIK though. Oscar -- ,-_ A little government and a little luck are necessary in life; /() ) but only a fool trusts either of them. (__ ( =/ () -- P.J. O'Rourke ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
