cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <j...@media.demon.co.uk>
Subject Re: Configuring OJB and HSQLDB
Date Tue, 18 Jan 2005 13:33:54 GMT

On 18 Jan 2005, at 12:30, Jeremy Quinn wrote:

> Hi All
>
> I have been working on adding the ability to save favourite queries to 
> HSQLDB using OBJ, to the QueryBean Block in trunk.
>
> While doing this work, several issues arose in the configuration of 
> OJB in Cocoon.
>
> Sequences:
> Even though the 
> org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl was 
> specified in OJB's repository.xml, it was not possible to use this 
> (via autoincrement="true") as the Tables that HSQLDB required to track 
> the sequences were missing from cocoon.db and the mapping for the 
> sequences (repository_internal.xml) were missing from OJB.
>
> I expect to add both of these during my commit of the new QueryBean 
> stuff.

I am splitting repository.xml into :

	repository_database.xml
	repository_internal.xml
	repository_user.xml

Then importing them all into repository.xml using entities.

>
> Custom Config:
> Any block that wants to make use of OJB and HSQLDB has to have extra 
> configuration added to both the database block (to add the Tables) and 
> the OJB block (to add the mappings).
> At the moment, Tables are created by adding new commands to the 
> Database Block's 'conf/cocoon.db',

Sorry, that was supposed to be conf/cocoondb.script

> and new OJB Mappings are made by adding them to OJB Block's 
> conf/repository.xml.
>
> This does not seem like a great solution to me.
>
> While it is likely that cocoon.db is not such a big issue, because 
> most people would probably replace HSQLDB on major projects and 
> therefore find a better way to populate their RDBMS.
>
> Is it worth looking for a way for Blocks to add their own Table 
> creating commands to cocoon.db in the Database block?

I wonder if this could be done using the Concat Ant Task.

> I think that the situation with OBJ could easily be improved.
>
> OJB typically uses Entities to import multiple repository_*.xml files 
> into the primary repository.xml file used to declare mappings and 
> database access. I am using this technique to add (the standard) 
> 'repository_internal.xml' to handle DB Sequences.
>
> I propose that we add an empty "repository_user.xml" file (with 
> associated Entity-based import) so that that file can act as a 
> standard target for projects that use OJB to use XConfPatch Task to 
> add their mappings to OJB. I suspect though that this would require 
> that the build processes blocks in a predictable order, and I do not 
> know if that happens.

We would need to define a new type of XPatchConf file ..... *.xojb ???
That can trigger a patch into repository_user.xml.

This, and the possible concat above could be added to the *-patch 
section of blocks-build.xsl.

I suspect it would be difficult to make the concat of files into 
cocoondb.script work as well as XConfPatch Task works, as it is more 
difficult to have conditional inclusion, meaning you could easily get 
duplicated lines.

WDYT?

regards Jeremy

---------------------------------------------------------
Life has surface noise

John Peel


Mime
View raw message