ODBC pessimistic lock - Mailing list pgsql-odbc

From Marian Naghen
Subject ODBC pessimistic lock
Date
Msg-id 003101c5e9db$b44641a0$f503a8c0@lapcontr01
Whole thread Raw
List pgsql-odbc
How can I aquire pessimistic locking using MFC ODCB classes ?
 
I used this code but no exception is raising on the second process.
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

CString sSQL = "SELECT * FROM table_1 WHERE table_id = 1 FOR UPDATE";

// open recordset:

try

{

    if(!m_pSet->IsOpen())

    {

        m_db.BeginTrans();

        m_pSet->Open(CRecordset::snapshot, sSQL); // dynasets not supported

    }

}

catch(CDBException *e)

{

    e->ReportError();

    e->Delete();

    m_db.Rollback();

}

//////////////////////////////////////////////////////////

 

Thanx.

pgsql-odbc by date:

Previous
From: Thomas Chabaud
Date:
Subject: Re: : Strange things with VB6 in adUseServer mode
Next
From: "Dave Page"
Date:
Subject: Re: psqlOdbc Ansi + BDE issues