cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfredas Chmieliauskas <>
Subject IMPORTANT: Major Bug in XMLDBSource
Date Fri, 28 Jun 2002 20:49:36 GMT
  Hi all,

this bug relates to every cocoon and xindice versions available, thus it 
definately concerns you, if you're using xmldb and accessing it through 
XMLDBSource (xmldb: pseudo-protocol).

Short history:
We're developing a project that is based on cocoon + xindice and, for a 
while, we were wonering why using cocoon and xindice causes such high 
memory consumption, which on higher loads terminates xindice with an 
OutOfMemoryError. Moreover, similar problems have been reported to both 
lists some time ago.

No doubt about cocoon, I was blaming xindice for the error (that corba 
implementation seemed suspicious from the very begining). However, after 
some memory profiling done for both cocoon and xindice, I got myself to 
check out and revise the XMLDBSource source-code, which turned out to be 
the cause of the problem in the end.

The error is as follows:
Every new request to the database creates new XMLDBSource, which in turn 
registers a database implementation (driver) 
(DatabaseManager.registerDatabase(...)) *every time* it is created.

Thus after 15 requests to your databse you have 15 database client 
implemetations loaded by your VM.
You can guess what happens when you have 150 requests, can't you? ;-)

A reasonable and quick fix for the problem would be to move the 
connect() method from the XMLDBSource to the XMLDBSourceFactory.
Why, on earth, would one bother about the connection in the source 
methods, when it is the major concern for the SourceFactory, i wonder?

It seems that commonly the rdbms drivers are loaded through the 
cocoon.xconf or web.xml on servlet startup (hsqldb, for example?). Why 
not treat the xmldb drivers the same way?

I hope I saved some time (and memory ;-) for some of you,


Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message