• 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
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enthuware questions

 
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following are true regarding a bean with bean managed transaction demarcation?

One of the options to this was
If it is a message-driven bean, it must commit a transaction (if it exists) before its message listener method returns.

The explaination given was
This is not fully true. A message driven bean may commit the transaction even in a timeout callback method.

Is this possible?


Secondly, there are loads of tiny details in this exam. Is the exam going to be this tough?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Core specification, 13.3.3 Enterprise Beans Using Bean-Managed Transaction Demarcation

A message-driven bean instance must commit a transaction before a message listener method or timeout callback method returns.
 
Nikhil Jain
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But does this mean that transaction was started in onMessage & commited in Timeout.??
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm not sure about that: the specs say that a stateful session bean may commit a started transaction before the business method returns.
Instead, for stateless session bean/mdb I suppose that it means that if I create a transaction in a business method, I have to commit before return.
The same is for timeout callback methods.

Finally, in 13.6.1, the specs say:


If a stateless session bean instance starts a transaction in a business method or interceptor method, it must commit the transaction before the business method (or all its interceptor methods) returns.



I hope this helps
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mmmhh, forget by previous "yes". Thinking about it twice, it does not seem possible. By the way, when a timeout happens in a MDB, in which transaction context will the timeout callback run ? Unspecified transaction context ?
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to what I remember, timeout callback transaction rules are the same as a business method, except for the fact that, in case of container managed transaction, it can be only REQUIRED, REQUIRES_NEW and NOT_SUPPORTED.
 
Nikhil Jain
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, but the option to the question was so confusing. I hope the questions in the real exam are clear & crip!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic