I am writing a program which will have some workthreads visiting a database
source simultaneously.
My Questions is:
1.is it a proper idea if I establish a single connection then every
workthread share it? 2.in this case, should i treat the connection as a
critical resource?
3.if the connection be closed out of the program,for example , administrator
shut down the database.how can i detect it?
4.is it efficient if I establish a new connection in every visiting to
database(close it when finish)?
thanks a lot!
sincerely,
Joshua