-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
KC Wolff-Ingham wrote:
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Hi Craig,
>
> I was hoping that JServ would support sharing of session objects between
> JServ instances. I believe that the next version of the Servlet API (2.1)
> supports a ServletContext mechanism for sharing objects between servlets.
> It is feasible that this could be coded to support the kind of functionality
> we are after.
>
The new servlet API versions (2.1 and 2.2) define the rules more clearly when
you are running in a multi-JVM environment, but there is no built-in support at
the API level for moving a particular session around. If the server does that
for you, it's all transparent to you (as long as you only store Serializable
objects in the user session, and mark your app as "distributable" for 2.2 based
servlet containers).
In the particular case of sessions, the 2.2 spec added a restriction that, at
any given point in time, all the requests with the same session ID must be
handled by the same JVM. This means you don't have to program around things
like inserting a new user value in one thread, but it not being visible in
other threads (because that thread was running on a different JVM). The app
server system can move you "in between" requests. I understand that some app
servers also can be configured to "broadcast" changes in the session data to
the other JVMs, but haven't investigated any restrictions this requires.
But again, this is all a server value-added feature, not something that you'll
see in every engine.
>
> We are looking at JavaSpaces at the moment, the problem with a JavaSpace
> however is that it is still a single point of failure (as with a database),
> an application running on a single machine. Admittedly you can configure a
> JavaSpace so that the objects are persistent and therefore a crash in the
> JavaSpace would be more of an inconvenience than a disaster. I did read a
> good article that claimed JavaSpaces would become really useful when
> multiple JVMs would hose a single JavaSpace with some complex algorithms to
> keep synchronisation.
>
> KC
>
Have any of the database vendors dealt with the "single point of failure"
problem? It would seem that servlet based applications are not the only ones
that would benefit from a fix to that.
Craig
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]