• 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

Bean Re-entrant

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic