• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

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?
 
My pie came with a little toothpic holding up this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic