- 论坛徽章:
- 15
|
问题问的很好,我也回答不了。不过我们可以讨论讨论。
这是JSESSIONID 的标准格式,里面就是你说的 JVM hash 值。- JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!SECONDARY_JVM_HASH!CREATION_TIME
复制代码 如果主服务当了, 就找第二个。 如果只有一个:- JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!CREATION_TIME
复制代码 服务没有重启前,PRIMARY_JVMID_HASH 或者SECONDARY_JVM_HASH 通常不再变。所以weblogic就根据这个不变的 JVMID hash,自己会知道如何找到对应的服务去连, 你自己应该不用考虑。
除非主服务当了,就会跳去下一个,如果激活sesson replication, 你的数据会恢复。
这个是英文解释,你也可以看看。 (http://stackoverflow.com/questions/6429990/weblogic-jsessionid)
Looking at some randomly generated Weblogic JSessionIDs from my own application
BrYx4hyPZ4VSP9Wo4eU0OrqmhXMLFONbRHnpLFwRKZ9MSaf6wvYj!-314662473
and
BrYiFED29itaC4EBpWYM8RKVQQauHkvnTsA2OAKUPZXVc9oUD5fB!-784323496.
Now if you notice the part of the session id after the first ! i.e 314662473 and 784323496.
This number is the unique identifier that Weblogic gives to the running JVM i.e. the running Weblogic server.
If there is more than one server in your application, Weblogic knows how to route your session back to the correct server by using this 9 digit JVM number which is part of the session ID.
Each time you restart the weblogic server, it will generate a new JVM id and use it as long as that weblogic server is running. So any hits to that server will have the same ID at the end of the session ID.
The format of the session ID is:
JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!SECONDARY_JVM_HASH!CREATION_TIME
So if the primary is not available, it will try to jump over to secondary and if you have enabled session replication - then the session data can be recovered. If you are running only a single server on local, then the format is simply
JSESSIONID=SESSION_ID!PRIMARY_JVMID_HASH!CREATION_TIME
regarding some times it does not appear, I've seen it is usually a browser dependent whether the sessionid is shown in the address bar or not
|
|