X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2B7CCDB4F9 for ; Tue, 15 Nov 2005 05:49:23 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07749-05 for ; Tue, 15 Nov 2005 09:49:23 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 6BAE6DAC84 for ; Tue, 15 Nov 2005 05:49:20 -0400 (AST) Received: from deimos.ratb.ro (ns1.ratb.ro [212.93.129.164]) by svr2.postgresql.org (Postfix) with ESMTP id 21777F0B2F for ; Tue, 15 Nov 2005 09:49:21 +0000 (GMT) Received: by deimos.ratb.ro (Postfix, from userid 1773) id E8AC9B8950; Tue, 15 Nov 2005 11:29:40 +0200 (EET) Received: from lapcontr01 (unknown [192.168.3.245]) by deimos.ratb.ro (Postfix) with SMTP id 963EDB894D for ; Tue, 15 Nov 2005 11:29:40 +0200 (EET) Message-ID: <003101c5e9db$b44641a0$f503a8c0@lapcontr01> From: "Marian Naghen" To: Subject: ODBC pessimistic lock Date: Tue, 15 Nov 2005 11:57:08 -0000 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002E_01C5E9DB.B4388600" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.646 required=5 tests=[AWL=0.645, HTML_MESSAGE=0.001] X-Spam-Score: 0.646 X-Spam-Level: X-Archive-Number: 200511/160 X-Sequence-Number: 6396 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C5E9DB.B4388600 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 =3D "SELECT * FROM table_1 WHERE table_id =3D 1 FOR = UPDATE"; // open recordset: try { if(!m_pSet->IsOpen()) { m_db.BeginTrans();=20 m_pSet->Open(CRecordset::snapshot, sSQL); // dynasets not = supported } } catch(CDBException *e) { e->ReportError(); e->Delete(); m_db.Rollback(); } ////////////////////////////////////////////////////////// Thanx. ------=_NextPart_000_002E_01C5E9DB.B4388600 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
How can I aquire pessimistic locking = using MFC ODCB=20 classes ?
 
I used this code but no exception = is raising=20 on the second process.
 
////////////////////////////////////////////////////////////////= /////////////////////////////////////////////////

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

// open = recordset:

try

{

   =20 if(!m_pSet->IsOpen())

    {

        = m_db.BeginTrans();=20

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

    }

}

catch(CDBException *e)

{

    = e->ReportError();

    e->Delete();

    m_db.Rollback();

}

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

 

Thanx.

------=_NextPart_000_002E_01C5E9DB.B4388600--