This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes How the object is passed in EJB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How the object is passed in EJB?" Watch "How the object is passed in EJB?" New topic

How the object is passed in EJB?

nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
We know in Java, Objects are passed around by reference.
Come to Ejb, for example, Object A in URL1 wants to pass Object b to Objects C in URL2. If Object B only tell object C a reference of object B, it will overheat the NetWork, if Object C using Object B a lot.
My question is in EJBean, objects are till been passing by reference?
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
If you are using local interfaces then the object will always be passed by reference (only clients within the same JVM can use the local interface). If you are using remote interfaces and the client is in the same JVM as the ejb then most Application Server will default to pass by reference. If the client is in a separate JVM then the object MUST be passed by value.
If you want more detail I suggest you read the EJB 2.0 Specification.
[ December 22, 2002: Message edited by: Chris Mathews ]
I agree. Here's the link:
subject: How the object is passed in EJB?
It's not a secret anymore!