wood burning stoves 2.0*
The moose likes Servlets and the fly likes servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet" Watch "servlet" New topic


Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
I have a question.
I have a servlet.I want to load country from database and put in
application context.
My question is "Does the method called from init() to perform the above
has to synchronized " to be thread safe?

Thanks in advance,
Makarand Parab
Ranch Hand

Joined: Dec 10, 2004
Posts: 121
init() is called once and only once when the servlet is loaded[ During start up or when it handles the first request - as configured]. Any method called from the init() method will be called only once. So you don't have to worry about the thread safety and sync.

Makarand Parab
I agree. Here's the link: http://aspose.com/file-tools
subject: servlet
Similar Threads
design patterns - why to use and how to select them
Any experience with Maverick?
Struts vs Barracuda?
garbage collection problem
Struts 2 AJAX tag questions