From: Marian Naghen <naghen@ratb.ro>
To: pgsql-odbc@postgresql.org
Subject: ODBC pessimistic lock
Date: Tue, 15 Nov 2005 11:57:08 -0000
Message-ID: <003101c5e9db$b44641a0$f503a8c0@lapcontr01> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: naghen@ratb.ro
Subject: Re: ODBC pessimistic lock
In-Reply-To: <003101c5e9db$b44641a0$f503a8c0@lapcontr01>
References: <003101c5e9db$b44641a0$f503a8c0@lapcontr01>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox