Forum OpenACS Q&A: Re: When using cronjob - missing ad_conn information

Collapse
Posted by Tilmann Singer on
I have been running into the same problem when writing migration scripts that call dotlrn operations from a detached thread. These operations rely on ad_conn for things like the user_id and ip address of the user that creates the class. The solution is quite easy - just set these values manually before calling the dotlrn procs like this:

ad_conn -set user_id $my_automated_user_id
...

There were some places that called ns_conn directly instead of ad_conn, especially in file-storage or the dotlrn parts of it. This defeats that strategy, but they can easily be replaced with ad_conn - I'm not sure if I committed all the replacements I did to cvs.