Originally posted by Keith Lynn:
Can you demonstrate why you think new Connections are being created?
Originally posted by Ernest Friedman-Hill:
The use of the static variable is not thread safe, so it's actually possible for more than one connection to be opened, but not every time. Is the problem just that you see more than one connection, or do you really see one every time?
Also, note that static variables are per-ClassLoader. If your classes are loaded by more than one ClassLoader, as in a Servlet container, you could see multiple connections. And of course if there's more than one JVM involved, each JVM has its own copy(ies) too.
Originally posted by Sani babangida:
...The Problem is instead of reusing an allready instantiated connection..the two application keep
instantiating new connections. And i am using "static" for the connection variable what can be the issue here, any suggestion would be welcome
Originally posted by Mr. C Lamont Gilbert:
Two applications? You are using this from two separate JVMs?