users@glassfish.java.net

life of a object.

From: <glassfish_at_javadesktop.org>
Date: Wed, 02 Jan 2008 20:05:12 PST

hi,
I am new to the java web service.

I am writing a jax-ws server, and there is 2 methods going to be called, methodA() and methodB().

Both of them involved database operations, and logging operations, and there is going to be lot of global variables to be read to the object.

I have implemented a method init(), that method reads a file and initialized the object.

do I need to call the init() everytime when the client called methodA() and methodB() to make sure every variable is set, or I just need to call it once, and the global variable will be set forever? is there any function that I can override, so whenever the server started/restarted, it will auto initialize the object, thanks.
[Message sent by forum member 'ctpoon' (ctpoon)]

http://forums.java.net/jive/thread.jspa?messageID=252061