K
Ken
Right now for testing I am opening up a DB connection and closing it
for every query. This is because I was just doing quick testing.
What I am going to do is make the connection a singleton, open the
connection the first query (or perhaps even before) and then only
reopen the connection if the DB has closed it (an exception is thrown
by the SQL statement), I'll put a Boolean condition in to test if I've
tried to recover once and if it fails twice bail.
I also think this is such a simple thing there might be some well
known object to do this for me and handle further db issues that I
would end up hand rolling too?
Any advice?
for every query. This is because I was just doing quick testing.
What I am going to do is make the connection a singleton, open the
connection the first query (or perhaps even before) and then only
reopen the connection if the DB has closed it (an exception is thrown
by the SQL statement), I'll put a Boolean condition in to test if I've
tried to recover once and if it fails twice bail.
I also think this is such a simple thing there might be some well
known object to do this for me and handle further db issues that I
would end up hand rolling too?
Any advice?