[jdom-interest] Ampersand question

tsasala at hifusion.com tsasala at hifusion.com
Thu Jul 13 12:32:02 PDT 2000


	The use of string, unfortunely, is not my choice.  This is
the way "content" is persisted to our database.  There little I can
do to affect that for now.

	I'm curious to know what you mean by "streams" coming
from the database.  JDBC is returning a resultset, not streams.
The objects within the results are then mapped to objects; in this
case a stream representing the JDOM object.


Alex Chaffee wrote:
> >         Also, we are throwing around a combination of strings and JDOM
> > documents.  [...]
> Your need is clear, and very compelling.  One important point I'd like
> to emphasize:
> Strings are SLOW.
> Moreover, they fill up the heap like crazy.  The architecture you
> described will probably be very clean and straightforward to write,
> and perform very poorly.
> You might be better advised to use streams and buffers rather than
> generating a new String for every document.
> Likewise, when reading a blob from the DB, you get it as a stream; why
> bother going through the extra step of converting it into a string,
> then parsing the string, when you can just parse it directly as a
> stream?  Same goes for writing to the DB.
>  - Alex
> --
> Alex Chaffee                       mailto:alex at jguru.com
> jGuru - Java News and FAQs         http://www.jguru.com/alex/
> Creator of Gamelan                 http://www.gamelan.com/
> Founder of Purple Technology       http://www.purpletech.com/
> Curator of Stinky Art Collective   http://www.stinky.com/

More information about the jdom-interest mailing list