Hello,
I am having simple 'java client' to access my 'stateless session bean' deployed in weblogic 6.1. I want pass a parameter to a method of bean, and want modified value back in client in 'same' parameter.
How do I do this?
The summary is: Is there any support for OUT/INOUT parameters in stateless session beans?
Thanks in advance for any clue...
-sanjay
Discussions
EJB programming & troubleshooting: How to access OUT/INOUT parameters of Stateless Session Bean
-
How to access OUT/INOUT parameters of Stateless Session Bean (6 messages)
- Posted by: sanjay prasad
- Posted on: October 28 2003 01:17 EST
Threaded Messages (6)
- How to access OUT/INOUT parameters of Stateless Session Bean by stephen smithstone on October 28 2003 01:44 EST
- re:wrapper classes by Al Bug on October 28 2003 07:50 EST
- Re: How to access OUT/INOUT parameters of Stateless Session Bean by Valery Silaev on October 28 2003 16:28 EST
-
Re: How to access OUT/INOUT parameters of Stateless Session Bean by sanjay prasad on October 29 2003 05:22 EST
- Re: How to access OUT/INOUT parameters of Stateless Session Bean by Valery Silaev on October 30 2003 06:28 EST
-
Re: How to access OUT/INOUT parameters of Stateless Session Bean by sanjay prasad on October 29 2003 05:22 EST
- How to access OUT/INOUT parameters of Stateless Session Bean by Tomas Inger on October 28 2003 02:54 EST
-
How to access OUT/INOUT parameters of Stateless Session Bean[ Go to top ]
- Posted by: stephen smithstone
- Posted on: October 28 2003 01:44 EST
- in response to sanjay prasad
Hello,
> I am having simple 'java client' to access my 'stateless session bean' deployed in weblogic 6.1. I want pass a parameter to a method of bean, and want modified value back in client in 'same' parameter.
> How do I do this?
>
> The summary is: Is there any support for OUT/INOUT parameters in stateless session beans?
>
>
> Thanks in advance for any clue...
> -sanjay
just create a standard method make sure the parameter you pass implements java.io.Serializable or if its a primitive type use the wrapper ie int->Integer -
re:wrapper classes[ Go to top ]
- Posted by: Al Bug
- Posted on: October 28 2003 07:50 EST
- in response to stephen smithstone
Did you try to update int value in Integer object, for example ? ;-)
All wrapper classes are immutable. -
Re: How to access OUT/INOUT parameters of Stateless Session Bean[ Go to top ]
- Posted by: Valery Silaev
- Posted on: October 28 2003 16:28 EST
- in response to stephen smithstone
The summary is: Is there any support for OUT/INOUT parameters in stateless session beans?
just create a standard method make sure the parameter you pass implements java.io.Serializable
:-)))
...and your parameters will be successfully serialized when they are passed in forward (Client -> SLSB) direction. BTW, requirement of Remote interfaces. And now what kind of magic serializes them back?
or if its a primitive type use the wrapper ie int->Integer
No comments. Mutable java.lang.Integer? Or you have your own wrapper?
VS -
Re: How to access OUT/INOUT parameters of Stateless Session Bean[ Go to top ]
- Posted by: sanjay prasad
- Posted on: October 29 2003 05:22 EST
- in response to Valery Silaev
VS,
I tried both the things (Integer wrapper for primitive datatype and serialized object as well), But It does not work.
I think EJB does not support the concept of OUT/INOUT for remotely deployed beans, because parameters are passed by value NOT by reference ( as in the case of local deployed beans). This is described in EJB 2.0 SPEC sec 5, as replied by one of my folks. -
Re: How to access OUT/INOUT parameters of Stateless Session Bean[ Go to top ]
- Posted by: Valery Silaev
- Posted on: October 30 2003 06:28 EST
- in response to sanjay prasad
sanjay prasad
VS,
I tried both the things (Integer wrapper for primitive datatype and serialized object as well), But It does not work.
You did not notice "smile" in my message. I mean exactly what you are saying -- the proposed "solution" will NOT work.
I think EJB does not support the concept of OUT/INOUT for remotely deployed beans, because parameters are passed by value NOT by reference ( as in the case of local deployed beans). This is described in EJB 2.0 SPEC sec 5, as replied by one of my folks.
Exactly. This is what I sayed about serialization. In remote calls parameters passed by client are serialized and transfered to server. But there is no magic that passes modified parameters back to client.
VS -
How to access OUT/INOUT parameters of Stateless Session Bean[ Go to top ]
- Posted by: Tomas Inger
- Posted on: October 28 2003 02:54 EST
- in response to sanjay prasad
Hi!
If a "normal" Java process accesses an EJB, all parameters are passes by value. This means the EJB will get a copy of the object. If that object is changed within the EJB code, the client will still keep it's original copy. The only way to return a value from an EJB to the client (outside the EJB container) is to use a return value (or an exception).
See chapter 5 in the EJB 2.1 spec. for details. The list in section 5.4 gives a good description on this.
/Tomas