users@glassfish.java.net

Re: How to take the same Stateful Bean from Remote RMI-IIOP and Local Stat

From: Miroslav Nachev <miro_at_space-comm.com>
Date: Wed, 21 May 2008 17:57:47 +0300

Hi,

> in general, each lookup (from anywhere) returns a reference to a new stateful bean instance.
I am not agree with that. I do the simple tests and I see that all
lookups from the JWS (JNLP, RMI-IIOP) returns the same instance.
Unfortunately this is not the case when the lookups are coming from the
server. You can see:
 * 1. Client -> SS1 -> SF1
 * 2. Client -> SF1
 * 3. Client -> SF2
 * 4. Client -> SS2 -> SF2
 * 5. Client -> SF1 -> SF2
 * 6. Client -> SF1 -> SS1 -> SF1
 * 7. Client -> SF1 -> SS1 -> SF2
 * 8. Client -> SF2 -> SS2 -> SF2

localCall: test._SF1Bean_Serializable_at_1a0b066, id:4, test 1
localCall: test._SF1Bean_Serializable_at_1a0b066, id:4, test 6

remoteCall: test._SF1Bean_Serializable_at_5670b4, id:1, test 2
remoteCall: test._SF1Bean_Serializable_at_5670b4, id:1, test 5
remoteCall: test._SF1Bean_Serializable_at_5670b4, id:1, test 6
remoteCall: test._SF1Bean_Serializable_at_5670b4, id:1, test 7

remoteCall: test._SF2Bean_Serializable_at_a16872, id:3, test 3
remoteCall: test._SF2Bean_Serializable_at_a16872, id:3, test 8

localCall: test._SF2Bean_Serializable_at_460b07, id:9, test 4
localCall: test._SF2Bean_Serializable_at_460b07, id:9, test 8

localCall: test._SF2Bean_Serializable_at_1f440e7, id:2, test 5
localCall: test._SF2Bean_Serializable_at_131370f, id:6, test 7

All calls from the Clients using remoteCall returns the same instance
with Id:1 for SF1 and Id:3 for SF2.

The problem which I can't solve is that I need to store some User
Session specific data which to be common for all: Client (Swing), Server
(Stateful and Stateless beans). Can you give me some suggestion how to
solve that?
For example if insteand Swing JWS Client I am using HTTP Client I can
put that data in HTTPSession.


Regards,
Miro.


glassfish_at_javadesktop.org wrote:
> Not sure I understand your question, but in general, each lookup (from anywhere) returns a reference to a new stateful bean instance. All client invocation thru the same bean reference will be serviced by the same stateful bean instance, from the client's point of view.
>
> -cheng
> [Message sent by forum member 'cf126330' (cf126330)]
>
> http://forums.java.net/jive/thread.jspa?messageID=275738
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>