SFSB Instance Sharing across multiple servers/SFSB failover practices

Hello:

My question is in two parts. I have spent a great deal of time searching the forums without a satisfactory answer, so I thought I'd post my question directly.

1) I have two clients that can potentially talk to two different servers, but they both need to interact with the same instance of a SFSB. For example, the first client calls the SFSB and causes it to save some state in its instance variables. The second client connects to a different server (because of a "network dispatcher" load-balancing architecture), but needs to use the same instance of the SFSB that the first client initialized. The two clients will not always talk to different servers, but the possibility exists that they might.

2) What is the proper design pattern for "fail-over" for a SFSB. For example, a client establishes a session, tickles a SFSB and causes its instance variables to contain state, and then WHAMO the application server crashes or becomes unavailable for some reason. We have in place a mechanism to reroute further client request to a second application server, but currently it is a problem because even though the failover is transparent to the client, the backup server creates a new instance of the SFSB and therefore it has none of the previous state information.

I'm thinking that the answer to one of these questions will be the answer to the other.

A little bit of background: this is not a theoretical application. We are building 250+ cars per day, ramping up quickly to 500-650 cars per day. I'm hoping I can solve this problem from an architectural standpoint, without having to modify each individual bean, because we have on the order of 200-300 SFSBs that would have to be changed--not a pretty thing in a production critical application. We have two AIX servers, but one of them is currenlty just a hot standby because we cannot run both of them at the same time because of problem 1) from above. We'd like to be able to run both servers at the same time for load-balancing purposes. Furthermore, if one box fails then all SFSB data will be lost because of the problem is mentioned problem 2) above.

(As a point of clarification, and only because I don't know if this affects any possible suggestions, but the clients do not use remote references to the EJBs. They simply pass "data containers" via HTTP to the server, and this data is passed to the various EJBs and returned back to the client via HTTP Response and in some cases TCP/IP. In either case, we do not use "remote object" references in the most typical sense. The servlet maintains the references to the EJBs.)

I've read things about "session clustering" but have not pinned down the subject. I have the "Core J2EE Patterns" book on order.

Any suggestions or pointers to reading materials would be greatly, greatly appreciated. I also welcome the "what you should have done" variety suggestions.

Thanks!

Regards,

Doug Wilkerson

[2998 byte] By [doug_wilkerson] at [2007-9-27 3:23:22]
# 1
One more thing (if it matters): We're running Websphere Application Server 3.5.2 with DB2 6.1 on AIX 4.3.3.0Thanks again!Regards,Doug Wilkerson
doug_wilkerson at 2007-7-5 1:12:53 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

Doug,

Here are my thoughts, I hope they help.

I don't think there is a possibility to have two different client (different sessions) talk to one and the same SFSB. A SFSB is specific to a users session and cannot be shared.

The way I would tackle this problem is probably by using SLSB which might access either an entity bean or the DB directly. This way, you might cause DB overhead, but you can share the data between clustered servers and the users will work with the correct data.

About the second question, I don't really now a pattern to provide fail-over for SFSB. To my opinion that is the weakest side of SFSB (beside all the load-balancing that needs to take place).

Hope this helps.

pdbc at 2007-7-5 1:12:53 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
I'm finding this stuff out myself. Basically, SFSBs don't scale well, so avoid them in scaleable environments. Break your work down into smaller chunks so that they can be accomplished with SLSBs.Thanks for the input.
doug_wilkerson at 2007-7-5 1:12:53 > top of Java-index,Other Topics,Patterns & OO Design...