• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parameters passing across the local interfaces

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB specification pt# 5.3 says that,
In general, the references that are passed across the local interface cannot be used
outside of the immediate call chain and must never be stored as part of the state of another enterprise
bean.

I dont understand the above statement
Please explain.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically this means that the local ejb should not retain references to objects passed to it as parameters and then use these objects in subsequent invocations. The problem here is that the local client and countless other objects could also have references to these same parameters and it would not be cool to have the local ejb fiddle with them at random times.
Therefore, if the local ejb needs to keep some data passed to it then it should explicitly copy the object. This way the local ejb's data would then be independent of the local client's data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!