-
1. Re: Local Session Bean Failover
daorriss Aug 31, 2004 11:20 AM (in response to jcr)Interesting... I'm actually having problems figuring out how to handle failover in JBoss with *remote* access to SFSBs. Can you point me to a code example somewhere so I can try and fix *this* part? Perhaps we can then put our heads together to solve the local interface access problem (tho I think I might already know what your problem is - just not sure).
Hope to hear from you soon. -
2. Re: Local Session Bean Failover
jcr Aug 31, 2004 5:55 PM (in response to jcr)For failover at the web layer I created an object I call SessionCache, which I store in the use session.
public class SessionCache implements Serializable {
private transient Hashtable sessBeans = new Hashtable();
private Hashtable sessHandles = new Hashtable();
public SessionBean getSessionBean (String name) {
SessionBean sb = null;
Handle hh = null;
if ((sb = (SessionBean )sessBeans.get (name)) == null) {
if ((hh = (Handle )sessHandles.get(name)) != null) {
sb = hh.getEJBObject();
} else {
// make session bean here
}
}
return sb;
}
}
Hope this helps,
Jared