could you please upload your process that illustrates that?
I would like to give it a try and play around with it for a while. It is very interesting issue that needs to be verified.
In general user code is working fine when it is deployed to data base (I use it all the time) but as you wrote perhaps it works only for activities but not for variables.
Cheers,
Maciej