07-10-2018, 10:01 PM
(07-05-2018, 02:24 AM)morhous Wrote: should set connection server controller or , user session
Just complementing Dan's answer:
as a rule of thumb, nothing which is shared should ever be put in ServerController. Not even if you have some internal critical section to avoid concurrent access to that resource.
If multiple sessions need access to some type of resource (file, Database, network, e-mail server, whatever), this should be put in UserSession, or - my preferred solution - create a class which does what needs to be done, instantiate it when needed, do what needs to be done and then release it. Of course, this solution doesn't apply to Database connections.