nerdexam
Oracle

1Z0-895 · Question #61

Suppose a developer wants to create an automatic persistent timer that performs data validation every hour. Given the following stateless session bean: @Stateless Public class OrderVerificationBean…

The correct answer is B. Modify the verifyExternalOrders method to look like this. Not D: 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…

Timer Service

Question

Suppose a developer wants to create an automatic persistent timer that performs data validation every hour. Given the following stateless session bean: @Stateless Public class OrderVerificationBean { Private void verificationExternalOrders () { / / do something } } What is the minimum modification you would need to make to the bean to create the automatic persistent timer?

Options

  • AModify the verifyExternalOrders methos to look like this:
  • BModify the verifyExternalOrders method to look like this:
  • CModify the verifyExternalOrders method to look like this:
  • DModify the verifyExternalOrders method to look like this:

How the community answered

(49 responses)
  • A
    10% (5)
  • B
    82% (40)
  • C
    2% (1)
  • D
    6% (3)

Explanation

Not D: 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. Nonpersistent programmatic timers are created by calling TimerConfig.setPersistent(false) and passing the TimerConfig object to one of the timer-creation

Topics

#automatic persistent timer#@Schedule#stateless session bean#timer creation

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice