The only way to pass something by reference, sort of, in EJB is to use a
remote object.  You create an interface for your object which implements
Remote, use that as a parameter in the EJB, and then send int an instance of
that remote object's implementation.  This way, the actual object will sit
on your client, and the app server will make calls on it.

However,  I wouldn't suggest doing it that way.  It's extra trouble (you
have the additional step of using the rmi compiler,) it can be confusing,
and it probably won't work with all app servers (e.g. if you were using
RMI-IIOP, you'd have to use the -iiop flag with rmic.)

Could you just return a serializable object which wraps the items you want
to return?

Mike

----- Original Message -----
From: "Ivan Novick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 12:36 AM
Subject: [JBoss-user] pass by reference


> Hi,
>
> Can an object be passed by reference to an EJB, filled with data, and than
> have that data analyzed in the function that called the EJB?
>
> The problem is, I need to return multiple values from the function.
>
> So I setup an EJB method like such
>
> boolean GetUserData(String username, UserData ud)
>
> the UserData class implements Serializable.
>
> So far, it is not working because after the method call, a null pointer
> exception is thrown when accessing the UserData object.
>
> Ivan
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to