Hi,

There is something that I can't find a clear answer for in the jsp1.2 and
servlet2.3 specs. I have an application with a <jsp:useBean
id="findTicketArgs" scope="session"
class="nl.gx.support.ticket.FindTicketArgs" /> that I want to run in a
clustered environment with fail-over.

>From jsp1.2 sect 4.1 I conclude that the object will be bound to the session
only once, after that I just update attributes within my own class without
changing this session binding.

>From servlet2.3 sect 7.7.2 the paragraph starting with 'If distributed
containers persist..' I get the guarantee that my bean and its complete
serializable closure will be preserved 'IF the container persists or
migrates' it.

My problem lies in WHEN can a container 'persist or migrate' my bean. Right
now the servlet spec doesn't mention this, but if it is done only when an
object is actually associated with the session, the jsp:useBean action will
not work properly in a clustered environment. Changes to its internal state
that occur after its creation would not be replicated to another server in
the cluster.

Some additional information that I found on this subject is:

- Orion 1.4.5 seems to replicate my bean only once: the first time that my
jsp:usebean is executed.
- Weblogic Server 6.0 will only replicate changes to the session when
setAttribute() is used.
(http://edocs.bea.com/wls/docs60/cluster/servlet.html#1009846)
- In 'Java Server Programming J2EE Edition' published by Wrox it is also
recommended to use a setAttribute() call on every state change of the
underlying object (Chapter 9, Methods for managing state).

Regards,
Marcel Schutte


Reply via email to