Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Few doubts

 
Leena Diwan
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • 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
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • 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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic