I did a lot of research on the Internet, but I can’t find a final answer to my question, so I turned to the experts on this site.
When developing using java and Tomcat, I have a Singleton class that handles my database connection. So the question is, when do different users connect to my web application and my server side Java code executes its own single class?
For example:
User A is registered on my site. An instance of my singleton is created.
User B is registered on my site, is the same object (singleton) saved between two versions of java code? or each performance for user A and user B receive different singletones?
thank.
source
share