G
Guest
Hi
I am writing a fairly simple desktop app which will not be subject to great loads. Therefore this question is more for academic purposes
I have implemented a class that declares only static members and functions. I use this class to control my connections. There are just 2 methods; Open and Close. The connection object within the class is static and has public scope. It is created when the app is started. (This obviously enables connection pooling
This makes the code very simple. When I want to use a connection I just call myConnectionClass.Conn. No need to dimension anythinig, dispose etc. I just make sure I close it when the routine has finished
Is this OK? I am worried that by declaring just 1 connection as a static there will be threading issues. i.e. There may be a que of users waiting to use the single, shared connection object
What do you experts think
Andy Newland (MCAD
I am writing a fairly simple desktop app which will not be subject to great loads. Therefore this question is more for academic purposes
I have implemented a class that declares only static members and functions. I use this class to control my connections. There are just 2 methods; Open and Close. The connection object within the class is static and has public scope. It is created when the app is started. (This obviously enables connection pooling
This makes the code very simple. When I want to use a connection I just call myConnectionClass.Conn. No need to dimension anythinig, dispose etc. I just make sure I close it when the routine has finished
Is this OK? I am worried that by declaring just 1 connection as a static there will be threading issues. i.e. There may be a que of users waiting to use the single, shared connection object
What do you experts think
Andy Newland (MCAD