Are ll types of session beans supporting timer service?As per my understanding only stateless session bean supports it.
Also if i say When the server is shut down, the timer is persisted automatically and becomes active again
when the server is restarted can i consider as a true statement?
As per my understanding this is true only for persistent timers and you can easily disable persistent property programmatically.
I am only recommending this, since the information you are asking about is readily available in "Java EE 6 Tutorial" and can be found by everyone with minimal effort.
http://docs.oracle.com/javaee/6/tutorial/doc/bnboy.html
Hi Mike,
Thanks for the reply.Yes I also read this material.However in the exam I faced unanswerable question.It was so hard to choose 2 out of 4 options.
So according to the article only stateless beans supporttimerservice .So we can discard the statement "all types of session beans supports timers"
My second claim is if i say "timers are persisted automatically and become active when server is started" ,it is also wrong.
Programmatically you can disable the persistent=true flag( TimerConfig.setPersistent(false)).
So I could chose only 1 option out of 4 properly and above 2 statements were confusing and remaining option was definitely wrong.
My second claim is if i say "timers are persisted automatically and become active when server is started" ,it is also wrong.
This is in obvious contradiction with "The Java EE 6 Tutorial" - please make 100% certain you read and understood what is in there ?
Timers are persistent by default. If the server is shut down or crashes, persistent timers are saved and will become active again when the server is restarted. If a persistent timer expires while the server is down, the container will call the @Timeout method when the server is restarted.
Hi Mike,
Thanks again for the reply.Question does not specify about default configuration.
In case timer is created with TimerConfig.setPersistent(false) my claim is correct.
I think there is some thing is missing in the statement "timers are persisted automatically and become active when server is started"
This should be corrected as" timers are persisted automatically and become active when server is started under default configurations"
Thanks,
Isuru
Post by:autobot
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
a bit of art, as a gift, the permaculture playing cards