• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Java Beat Question

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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
 
Ranch Hand
Posts: 133
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.




 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That means answer to this question will be c
 
Krzysztof Koziol
Ranch Hand
Posts: 133
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
ScroogeXHTML - a fast and small RTF to HTML5 and XHTML converter library
https://coderanch.com/t/742149/ScroogeXHTML-RTF-HTML-XHTML-converter
reply
    Bookmark Topic Watch Topic
  • New Topic