BEA Weblogic Question:
Download Questions PDF

A stateful session bean implementing the SessionSynchronization interface is deployed on the WebLogic server. Which of the following callback methods may be invoked on the bean?

Answer:

a. beforeBegin
b. afterBegin
c. beforeCompletion
d. afterCompletion


Choices B, C and D are correct. A stateful session bean using container-managed transactions can implement the javax.ejb.SessionSynchronization interface to provide transaction synchronization notifications. This interface defines only 3 methods - afterBegin(), beforeCompletion() and afterCompletion().
The afterBegin() callback method is called when the bean becomes part of a transaction. It is called before the EJB Object delegates the business method invocation to the bean instance. If the transaction is committed, the bean will be notified through its beforeCompletion() method. If the transaction is rolled back, this method is not invoked. The afterCompletion() method is always invoked whether the transaction ended with a commit or a rollback. A is incorrect because beforeBegin is not a method defined in the SessionSynchronization interface.

Download BEA Weblogic Interview Questions And Answers PDF

Previous QuestionNext Question
Can WebLogic Server start with a UNIX boot?Which is the only method defined in the javax.ejb.Handle interface?