At the moment, you can only run one customer inside an OpenPetra server. You cannot have multiple tenants per OpenPetra server instance. This makes it quite expensive to offer mass hosting of OpenPetra, because you need to keep a server instance running for each customer. Offering free test machines comes at a cost too.
The reason is the use of static variables. Each request comes in its own thread, but threads are reused between the sessions, and static variables stay within the lifetime of the thread. You can see a test program in my Gist: https://gist.github.com/tpokorra/52bdfbf3472e3f214bdac90ab16b2543
Static variables are something like global variables, and they are considered bad practise.
So I will be getting rid of them.
Some can be replaced with static readonly, or const.
Some can be replaced by making the methods non-static.
I will be dropping the caches, since database queries are really fast nowadays.
For some things, I need to refactor the code, and use the sessions instead.
I have modified the CodeChecker tool, so that in the future we can run a check over the code base so that we know there is no hidden static variable anymore or creeping in again. nant checkCode
is the command.