Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Implicitly Started Transactions Find similar branches


Hermit   (2001-12-05 11:38) [0]

I just can’t figure it out.
I have a Query whose properties CachedUpdates and RequestLive are set to True and the UpdateTable procedure below is attached to the AfterDelete and AfterPost events.

procedure TDataMod.UpdateTable (DataSet: TDataSet);
begin
with DataSet as TDBDataSet do
begin
Database.StartTransaction;
try
ApplyUpdates;
Database.Commit;
except
Database.Rollback;
CancelUpdates;
raise;
end;
CommitUpdates;
end;
end;

All this works fine, but after putting Query into edit mode and then calling ApplyUpdates, the error "A user transaction is already in progress" appears.
Obviously, when you call Query.Edit, the transaction starts implicitly, but why does this error not occur when you call Query.Insert and then confirm the changes?



User_OKA   (2001-12-05 14:33) [1]

And if you check the InTransaction property before Database.StartTransaction?
For example, the
if not TIBTransaction.InTransaction then Database.StartTransaction;
If the implicit transaction has gone, then StartTransaction will not be executed.



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.55 MB
Time: 0.038 c
1 - 21999
elephant
2001-12-15 02:02
2002.01.08
C ++ or Delphi


3 - 21956
Sevostyanov Igor
2001-12-05 17:56
2002.01.08
Programmatically execute SHUTDOWN IMMEDIATE


4 - 22500
Yus
2001-11-06 20:32
2002.01.08
Coordinates of desktop icons


1 - 22012
Socol
2001-12-15 16:00
2002.01.08
Nikolay


1 - 22196
T2
2001-12-16 07:18
2002.01.08
Desktop off





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish