Home > Archive > PostgeSQL ODBC > November 2005 > ODBC pessimistic lock









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ODBC pessimistic lock
Marian Naghen

2005-11-15, 9:23 am

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::sna
pshot, sSQL); // dynasets not supported

}

}

catch(CDBException *e)

{

e->ReportError();

e->Delete();

m_db.Rollback();

}

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



Thanx.

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com