Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Question about JTA

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


While testing a BMP Entity Bean, a developer discovers that a transaction rollback does not cause a rollback of the changes made to the
bean as it should. Which of the following should the developer suspect?
a) The ejbPassivate() method has a bug.
b) The ejbStore() method has a bug.
c) The ejbCreate() method has a bug.
d) The datastore does not support JTA.
e) The transaction does not implement javax.transaction.UserTransaction.
Answers: b, d


Why d is also a correct answer? Thanks.
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anybody explain to me? Thanks. I don't know why.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is easier to explain why the other answers are not correct...
a) ejbPassivate() is not likely to come into play in this scenario and hence is not a usual suspect.
c) ejbCreate() is only involved when the entity is created. Since the question clearly states the the entity was changed, therefore it was already created, then ejbCreate() is not be called.
e) Frankly, this answer does not make any sense.
I remember this question from the IBM ICE test and we are told the question has exactly two answers, which only leaves b and d.
I think d is poorly worded. It should say something to the extent of the database not supporting transactions or XA protocol, I don't think it should explicitly mention JTA.
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chris Mathews:
It is easier to explain why the other answers are not correct...
a) ejbPassivate() is not likely to come into play in this scenario and hence is not a usual suspect.
c) ejbCreate() is only involved when the entity is created. Since the question clearly states the the entity was changed, therefore it was already created, then ejbCreate() is not be called.
e) Frankly, this answer does not make any sense.
I remember this question from the IBM ICE test and we are told the question has exactly two answers, which only leaves b and d.
I think d is poorly worded. It should say something to the extent of the database not supporting transactions or XA protocol, I don't think it should explicitly mention JTA.



Thanks Chris. Yes, this is from IMB ICE. I am just wondering if JTA or Transaction API is the guarantee to make a transaction roll back and make changes in the database.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic