Forum OpenACS Development: Re: Re: db_transaction side effects

Collapse
Posted by Jun Yamog on
Hi Dave,

I think those db_transaction calls was inherited from the bcms procs. By design the transaction are required.

content::item::new creates a new content item and an initial content revision if there some data (eg. title, description, etc.) passed in. The initial thought was its likely you will want to create a content revision after creating a content item. Calling one proc at that time made sense to me.

content::revision::new initially may not have db_transacation, however it seems the latest one will require it since when the revision is created, its then updated with the tmp_filename

Anyway I hope this gives some historical account of those procs. I am looking at the code by webcvs only, so add some grain of salt. I do agree with you in not adding a flag, semantically I meant to have the db operation atomic similar to the plsql version. Hopefully a good solution is found and keeping the db operation atomic.