• 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

Few doubts

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

I have few questions. Thought I will put them in a single post. Hope you will answer all.

1. What is reentrant?
2. If relations between entities need that both entities be local, does that lead to most (if not all?!) of the entity beans being local in an application?
3. What is the exact difference between a distirbuted vs a local transaction? Does a local transaction actually mean that all the participating beans/resources/classes etc are local?
4. This is in reference to the HFEJB chapter 10 - 9th exercise -
Which actions will the container take if a MDB with BMT demarcation throws a system exception?

One of the correct answers is -
'Mark the transaction for rollback'
Now, if it is a system exception, won't the transaction be rolled back? Instead of just being marked for a rollback?

Thank you in advance.

Regards,
Leena
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>>1. What is reentrant?

-> A reentrant bean can participate in loopback call sequences, which are call sequences where one of the bean's methods calls another component which in turn calls a method in the calling bean instance. Such requirement hardly arise in practice.

>>>2. If relations between entities need that both entities be local, does that lead to most (if not all?!) of the entity beans being local in an application?

-> Yes. Infact, I would like to keep all my entity beans local to the container and have coarse-grained session facades playing with the entity beans.

>>>3. What is the exact difference between a distirbuted vs a local transaction? Does a local transaction actually mean that all the participating beans/resources/classes etc are local?

-> Think of a distributed transaction as the one that can span across containers/database servers deployed on physically different machines. The containers/database servers can themselves be from different vendors.

>>>4. This is in reference to the HFEJB chapter 10 - 9th exercise -
Which actions will the container take if a MDB with BMT demarcation throws a system exception?

One of the correct answers is -
'Mark the transaction for rollback'
Now, if it is a system exception, won't the transaction be rolled back? Instead of just being marked for a rollback?

-> The container has to first mark the transaction for rollback so that callers of a method can 'check', using context.getRollbackOnly(), if the call was a success and possibly take a different action path or stop proceeding altogether (or some kind of optimization).
 
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic