cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Engelhart <>
Subject Re: Storing XML in databases w/o lots of string parsing....
Date Fri, 21 Apr 2000 15:46:02 GMT
Williams, Murray Todd wrote:

> I've presently got a small web application that stores XML content
> (personnel/project progress logs) in a database (MySQL) and allows a viewer
> to selectively view these logs through a web form in Cocoon.
> This works, but I can't help feeling a little bothered by the fact that I
> have to store the XML content in ASCII and run lots and lots of parsers on
> it.  What I'm wondering is if there is a better way to create some sort of
> binary serialization of the XML snippets so I can store them in more
> quickly-accessible form in some sort of SQL binary BLOB object.  I image
> this is akin to how the Cocoon cache system works, and I tried going through
> the source code, but I couldn't quite understand what was going on.

I have two simple classes (ObjectReader and ObjectWriter) that convert
arbitrary objects to ByteArrayOutputStream and ByteArrayInputStream to pass
onto a database using the standard JDBC call setBytes().
I haven't used it in a while because I wrote it to come up with a way to
load balance HttpSession objects but then found out that JServ plus Tomcat
could do a lot of that for me and I'm currently not concerned with
maintaining state for more than the time the user is on the site.  It should
be able to take a Node or any arbitrary object and stick it into a database.

anyway, let me know if you interested and I'll forward the source.  You may
need to tweak it a little bit to work with mySQL as I only tested it with


View raw message