problems with transactions in C++Builder

From: igor <igor_kh(at)mailru(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: problems with transactions in C++Builder
Date: 2000-06-28 06:47:47
Message-ID: 19111011504.20000628104747@mailru.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greatings!

Help me please to resolve my problem.
As appeared, postgesql server doesn't rollback transaction
in 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.

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2000-06-28 06:51:04 Re: Insert into a table with only a SERIAL
Previous Message Matthew 2000-06-28 05:13:19 RE: Connecting postgreSQL using JDBC