Forum OpenACS Development: Re: Error copying survey from one subsite to another

Collapse
Posted by Jeff Davis on
It is probably the order in which the objects are being copied. tree_sortkey has a not null constraint which means it can't be
null if the new.context_id acs_object already exists.
(that or the new.context_id is not set properly and is null or something).

I am pretty sure the acs_objects_insert_tr function is correct.

Collapse
3: I was nesting transactions (response to 2)
Posted by Esti Alvarez on
After 2 days trying anything you can think of, I've found what I was doing wrong: as I wanted to copy a bunch of surveys from one place to another, I had enclosed the function calls in a db_transaction creating another level of nested transactions with those ongoing inside the functions themselves. Removing the db_transaction, the problem dissapeared.

I hope this can save someone else's time.

Thanks Jeff! I was also sure the trigger definition was ok 😊