• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity beans Instance finding  RSS feed

 
Deepak Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an entity bean if i get a reference to a bean object for a particular key value.Then if during the time i use this instance if someone tries to get the reference for the same value of primary key.what happens???
Will there be another instance created or the other user will be made to wait???
[ January 25, 2002: Message edited by: vdeepak ]
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that JavaRanch has a naming requirement. You must change your display name to: your real first name - space - your real last name. Thanks.
As to your question: There is only one entity bean per primary key. The EJB server guarantees that all entity beans are thread safe. If for some reason it can not give the entity bean to another client then that client will wait. Think of it as a row in a database. If multiple simultaneous update requests are made then the second will wait until the first is committed or rolled back.
 
Deepak Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So for a particular bean if i set the transaction attribute to commit i.e if i make it atomic by grouping a set of methods together then does't it mean that the instance cannot be released until i execute all the methods.
And will this not degrade the performance.Could u explain it in more detail please???
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!