• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bean Re-entrant

 
Poornachandran R
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all,

First of all, let me explain what i have understood abt the re-entrant, it will like this :

Client -> Bean A -> Bean B -> Bean A.

Anyhow re-entrant is not possible in Session beans. In Entity beans we have to specify in deployment descriptors saying that, the bean should allow re-entrant.

My question is, why should we have to specify this ? Because, anyhow, all beans are single-threaded. So, Bean B will not get the same instance of Bean A which is being accessed by the client, Bean B will get another instance of Bean A. So, what is the problem in this ?

Poorna
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the bean instance you get for a database record is the same. With entity beans, the bean pool contains beans that are capable of "getting an identity" but once the identity has been given to a bean instance, further requests for that record are all mapped to that particular bean instance.
 
Poornachandran R
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for ur reply.
So...u mean to say that...same instance will be given to Bean B which is being accessed by the client. So, the bean instance has to be accessed in multi-threaded environment.
Correct me if i am wrong.
Poorna
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!