aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Java Beat Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Java Beat Question" Watch "Java Beat Question" New topic
Author

Java Beat Question

Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
@Stateful
public class TestBean implements Test, TimedObject
{
...
@TransactionAttribute(MANDATORY)
public void ejbTimeout(Timer timer)
{
}
}
Which of the following statements are true?
a. Only stateless session bean can implement the TimedObject interface.
b. It is not legal to define the transaction attribute 'MANDATORY' on the ejb timeout
callback method.
c. None of the above


Can a stateful bean implement TimedObject? please confirm

Thanks


"Know where to find the solution and how to use it - that's the secret of success."
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

According to a)
Only the SLSBs, MDBs an 2.1 Entity beans can use TimerService.

Accroding to b)
Callback timeout methods can have only the following transaction attributes: REQUIRED, REQUIRES_NEW, NOT_SUPPORTED. Therefore is not legal to define the MANDATORY propagation level for this method.





SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCEA/OCMJEA 5.0
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
That means answer to this question will be c
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

Amirr Rafique wrote:That means answer to this question will be c


Nope. In b) It says that is "not legal to define the transaction attribute 'MANDATORY' on the ejb timeout
callback method. " which is true. In my opinion the correct answer is b).
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Krzysztof Koziol wrote:
Amirr Rafique wrote:That means answer to this question will be c


Nope. In b) It says that is "not legal to define the transaction attribute 'MANDATORY' on the ejb timeout
callback method. " which is true. In my opinion the correct answer is b).


but the question is using TimedObject interface on @Statefull session beans which is not right? is it some typo error in java beat question?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Beat Question