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

How about going through the provided attributes, not use the attributes for lob-columns in the insert into the generated view and then doing a seperate update for each lob column? In pg, we wouldn't need to change anything.
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.

Collapse
Posted by Don Baccus on
This should be

1. TIP'd
2. Accepted

As we need this fix a little bit more urgent, I suggest that Timo fixes this, prepares a TIP with the patch and that the patch or a modification thereof is accepted. After all this is a bug in the content repository which we should have catched before releasing 5.1.4.
You can find my path here. If someone wants to tip it, go ahead. BTW: I'll also write a test case for that.
Collapse
Posted by Dave Bauer on
Since this just fixes a long standing bug in the CR, in a pretty usuable way, by abstracting the lob issues into one Tcl proc, I don't see a need for a TIP. It does not change existing behabior of content::revision::new except to supress error messages from attempting to inset into a CLOB.