Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] serializing XOM objects

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Steve Loughran <steve.loughran AT gmail.com>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] serializing XOM objects
  • Date: Wed, 1 Jun 2005 21:15:27 +0100

On 5/31/05, Luca Passani <passani AT eunet.no> wrote:
> Elliotte Harold wrote:
>
> >
> > What proof do you have that you're wasting CPU cycles? I'd surmise the
> > opposite. java's object serialization is notoriously inefficient. XML
> > routinely outperforms it.
> >
> but this is extremely easy to prove, in this case. In fact I can match
> whatever low use of CPU you can prove against my ZERO!
>
> To recap:
>
> - upon restarting, tomcat (and other app servers, I would imagine)
> freezes user session info for later. This implies
> that Java objects are serialized. This just happens and it's outside
> of developer control as far as I understand.
>
> http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Session-Tracking.html
>
> - my application (a servlet) builds the DOM for a big XML file and
> generates a bunch of XML bushes as by-products.
> I typically only need one of them, but I may need more if I receive
> more requests from the same user. Storing those bushes
> in the session is a marriage made in heaven. They'll be discarded
> naturally when the user session times out, while
> still available should the user request them.

tomcat save session state by s12-ing the stuff, I think that is
designed to make it easier to share state across a load balanced
cluster, like when you host tomcat in jboss; your state gets shared
across systems.

I've encountered past problems during hot update of tomcat where the
session cache doesnt purge properly, leading to entertaining version
errors. I'd hate to do a host-by-host live update of a big cluster
while running under real load for such reasons.

Similarly, you cant make session state persistent to HDD and expect it
to reload safely after a server restart, unless every persisting
object really persists properly.

I'd therefore argue that, in this particular case, instead of "Xom is
wrong to not seralize" a better claim is "servlet engines would be
less brittle if they used XML documents to represent session state,
not a graph of object instances".

-steve




Archive powered by MHonArc 2.6.24.

Top of Page