Forum OpenACS Development: Re: proposal on how to fix content repository for oracle

Collapse
Posted by Dave Bauer on
To clarify why we need this proposal:

In the content repository, there is a view created to make it easier to add new revisions of an object. This view allows one insert statement to set attributes for all subtypes of an object type. This does not quite work in Oracle because you may not insert into a BLOB or CLOB column. The reason one would want to choose a CLOB column in Oracle is the restriction of 4000 characters for a varchar.

So I can imagine a subtype of cr_revision that needed to capture a text attribute that was longer than 4000 characters. In this case, one would need to create a CLOB column in the subtype specific storage table. It would then be impossible to use the view, or the content::revision::new Tcl procedure to add a revision of this type.

Right now the "content" attribute of cr_revisions is updated after a new revision row is created. Timo is suggesting that content::revision::new also check the datatype of additional attributes, and only use non-LOB columns on insert and perform an UPDATE for all the LOB columns.

This is not needed on PostgreSQL since the Text datatype can store any amount of text data. This will cause the code in content::revision::new to have to branches one for Oracle and one for PostgreSQL.

This does excapulate the database specific code in one procedure. A similar prcoedure would also be necessary to abstract SELECTs from the cr_revisionx and subtype views.