Detecting broken connection to Sybase server.
- From: seamonster76@xxxxxxxxx
- Date: 16 Aug 2005 01:53:20 -0700
Hi,
I believe I am supposed to use ct_con_props in order to check the
connection status.
My program looks like the following...
// send command to the database
if ( CS_FAIL == (nRetVal = ct_send(m_pCmd) ) )
{
CS_INT status = CS_CONSTAT_DEAD;
ct_con_props(m_pDatabase->pCnx, CS_GET, CS_CON_STATUS,
NULL, 0, &status);
if(status & CS_CONSTAT_DEAD)
{
// Broken connection...
}
}
// make sure that send worked OK
if (CS_FAIL == (nRetVal = ct_results( m_pCmd, &nRetVal2) ) )
{
CS_INT status = CS_CONSTAT_DEAD;
ct_con_props(m_pDatabase->pCnx, CS_GET, CS_CON_STATUS,
NULL, 0, &status);
if(status & CS_CONSTAT_DEAD)
{
// Broken connection...
}
}
After I unplug the network cable, ct_results and ct_send return CS_FAIL
as expected. However, the ct_con_props reset the status to 0, instead
of indicating the connection is dead by setting the bitmap.
Did I do anything wrong or was I missing something?
Thanks for any help.
Andy
.
- Follow-Ups:
- Re: Detecting broken connection to Sybase server.
- From: SybaseNeal
- Re: Detecting broken connection to Sybase server.
- Prev by Date: Need Sybase DBA
- Next by Date: Formatting a number
- Previous by thread: Need Sybase DBA
- Next by thread: Re: Detecting broken connection to Sybase server.
- Index(es):
Relevant Pages
|
|