Обсуждение: Is there a way to check if a db connection handle is still valid?

Поиск
Список
Период
Сортировка

Is there a way to check if a db connection handle is still valid?

От
Antai Ning
Дата:
<p><font size="2">Hi there,</font><p><font size="2">Is there a way to check if a db connection handle is still
availble?My db program need to run forever and I found that if one insertion fails, the handle seems crashed. Then when
thenext insertion using the same handle will kill the whole program.</font><p><font size="2">Thanks in
advance!</font><p><fontsize="2">Andy </font> 

Re: Is there a way to check if a db connection handle is still valid?

От
Thomas Quinot
Дата:
You could probably try a query like 'SELECT 1;' and see if it succeeds.

Thomas.

--
    Thomas.Quinot@Cuivre.FR.EU.ORG