How to work with OpenX XMLRPC authentication / sessions
I'm having problems with Openx; here is the problem
OpenX :: Services :: Base.connection returns an @@ class connection that is populated by OpenX :: Services :: Base.connection if it has not been initialized previously.
The problem with being a class variable is that it persists across all connections, which means that if there is a lull in activity, the XMLRPC session between my site and OpenX will expire and the OpenX API has no conditions to transfer the expired session which would be wasteful anyway, as each request would require a request to make sure the session was still valid.
What I think would be the best way to do this is to create a connection at the beginning of any request that needs OpenX support, and close it at the end, ensuring that there is no session capability, on the XMLRPC side.
Has anyone else discovered this while using OpenX / OpenX XMLRPC? If so, how did you solve this problem?
a source to share
I have a try / catch block around an OpenX RPC call and I wrote an exception translator. If I define a session timeout, I do the login operation again, I take a new session ID, and I run the failed OpenX call again. This is a little more complicated than having a cron job to keep the session alive, but more efficient and reliable (in my opinion).
a source to share