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 <aning@jetnet.ca>
Дата:

Hi there,

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 the next insertion using the same handle will kill the whole program.

Thanks in advance!

Andy

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

От:
Thomas Quinot <thomas@cuivre.fr.eu.org>
Дата:
You could probably try a query like 'SELECT 1;' and see if it succeeds.

Thomas.

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