Обсуждение: problems with transactions in C++Builder

Поиск
Список
Период
Сортировка

problems with transactions in C++Builder

От
igor
Дата:
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.