Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Questions on InitialContext and replica-aware stub caching in weblogic 11g

We have a cluster and deployed with some stateless ejb session beans. Currently we only cached the InitialContext object in the client code, and I have several questions:

  1. in the current case, if we call lookup() to get a replica-aware stub, which server will return the stub object, the same server we get the InitialContext, or it will load balanced to other servers every time we call the lookup method?
  2. should we just cache the stub? is it thread safe? if it is, how does the stub handle concurrent requests from the client threads? in parallels or in sequence?
  3. One more question, when we call new InitialContext(), it will take a long time before it can return a timeout exception if the servers are not reachable, how can we set a timeout for this case?
like image 706
user1774136 Avatar asked Nov 13 '22 19:11

user1774136


1 Answers

The best way to know is to code a little test client.

You can check which server your stub came from using its toString() method, which should print a kind of URL (at least it did on WebLogic 10). It's possible you'll get surprised with the results.

like image 190
fglez Avatar answered Dec 26 '22 05:12

fglez