problems with transactions in C++Builder - Mailing list pgsql-general

From igor
Subject problems with transactions in C++Builder
Date
Msg-id 1341165475.20000629072301@mailru.com
Whole thread Raw
List pgsql-general
Greatings!

Help me please to resolve my problem.
As appeared, postgesql server doesn't rollback transaction,
when I use
C++ Builder environment. May be sombody have
an idea, how to make it work?
The test source in the bottom of the letter.

I will be very greatefull  for any help.

Igor.

======================================
  CD->srvdb->StartTransaction();
  CD->EQuery->Close();
  CD->EQuery->SQL->Clear();
  sprintf (str, "begin");
  CD->EQuery->SQL->Add(str);
  CD->EQuery->ExecSQL();

  CD->EQuery->Close();
  CD->EQuery->SQL->Clear();
  sprintf (str, "lock mytable");
  CD->EQuery->SQL->Add(str);
  CD->EQuery->ExecSQL();

   sprintf (str,"update mytable set \
   active=1 where st = '2020201'" );

 CD->EQuery->Close();
 CD->EQuery->SQL->Clear();
 CD->EQuery->SQL->Add(str);
 CD->EQuery->ExecSQL();


  CD->EQuery->SQL->Clear();
  sprintf (str, "abort");
  CD->EQuery->SQL->Add(str);
  CD->EQuery->ExecSQL();
  CD->srvdb->Rollback();

==============================

the field "active" save new value = 1 after
'abort' command.



pgsql-general by date:

Previous
From: igor
Date:
Subject: test
Next
From: "John Huttley"
Date:
Subject: Re: Limit for an transaction