1 |
+ |
(* |
2 |
+ |
* IBX For Lazarus (Firebird Express) |
3 |
+ |
* |
4 |
+ |
* The contents of this file are subject to the Initial Developer's |
5 |
+ |
* Public License Version 1.0 (the "License"); you may not use this |
6 |
+ |
* file except in compliance with the License. You may obtain a copy |
7 |
+ |
* of the License here: |
8 |
+ |
* |
9 |
+ |
* http://www.firebirdsql.org/index.php?op=doc&id=idpl |
10 |
+ |
* |
11 |
+ |
* Software distributed under the License is distributed on an "AS |
12 |
+ |
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
13 |
+ |
* implied. See the License for the specific language governing rights |
14 |
+ |
* and limitations under the License. |
15 |
+ |
* |
16 |
+ |
* The Initial Developer of the Original Code is Tony Whyman. |
17 |
+ |
* |
18 |
+ |
* The Original Code is (C) 2015 Tony Whyman, MWA Software |
19 |
+ |
* (http://www.mwasoftware.co.uk). |
20 |
+ |
* |
21 |
+ |
* All Rights Reserved. |
22 |
+ |
* |
23 |
+ |
* Contributor(s): ______________________________________. |
24 |
+ |
* |
25 |
+ |
*) |
26 |
+ |
|
27 |
|
unit LimboTransactionsUnit; |
28 |
|
|
29 |
|
{$mode objfpc}{$H+} |
42 |
|
Button2: TButton; |
43 |
|
Button3: TButton; |
44 |
|
Button4: TButton; |
45 |
< |
IBValidationService1: TIBValidationService; |
45 |
> |
LimboTransactionValidation: TIBValidationService; |
46 |
|
Label1: TLabel; |
47 |
|
StringGrid1: TStringGrid; |
48 |
|
procedure Button1Click(Sender: TObject); |
49 |
|
procedure Button2Click(Sender: TObject); |
50 |
|
procedure Button3Click(Sender: TObject); |
51 |
|
procedure Button4Click(Sender: TObject); |
52 |
+ |
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); |
53 |
|
procedure FormShow(Sender: TObject); |
54 |
|
procedure StringGrid1EditingDone(Sender: TObject); |
55 |
|
private |
70 |
|
|
71 |
|
{$R *.lfm} |
72 |
|
|
73 |
< |
uses Unit1; |
73 |
> |
uses MainFormUnit; |
74 |
|
|
75 |
|
{ TLimboTransactionsForm } |
76 |
|
|
81 |
|
|
82 |
|
procedure TLimboTransactionsForm.Button1Click(Sender: TObject); |
83 |
|
begin |
84 |
< |
IBValidationService1.GlobalAction := CommitGlobal; |
84 |
> |
LimboTransactionValidation.GlobalAction := CommitGlobal; |
85 |
|
RunGFix; |
86 |
|
end; |
87 |
|
|
88 |
|
procedure TLimboTransactionsForm.Button2Click(Sender: TObject); |
89 |
|
begin |
90 |
< |
IBValidationService1.GlobalAction := RollbackGlobal; |
90 |
> |
LimboTransactionValidation.GlobalAction := RollbackGlobal; |
91 |
|
RunGFix; |
92 |
|
end; |
93 |
|
|
94 |
|
procedure TLimboTransactionsForm.Button3Click(Sender: TObject); |
95 |
|
begin |
96 |
< |
IBValidationService1.GlobalAction := NoGlobalAction; |
96 |
> |
LimboTransactionValidation.GlobalAction := NoGlobalAction; |
97 |
|
RunGFix; |
98 |
|
end; |
99 |
|
|
100 |
|
procedure TLimboTransactionsForm.Button4Click(Sender: TObject); |
101 |
|
begin |
102 |
< |
IBValidationService1.GlobalAction := RecoverTwoPhaseGlobal; |
102 |
> |
LimboTransactionValidation.GlobalAction := RecoverTwoPhaseGlobal; |
103 |
|
RunGFix; |
104 |
|
end; |
105 |
|
|
106 |
+ |
procedure TLimboTransactionsForm.FormClose(Sender: TObject; |
107 |
+ |
var CloseAction: TCloseAction); |
108 |
+ |
begin |
109 |
+ |
end; |
110 |
+ |
|
111 |
|
procedure TLimboTransactionsForm.StringGrid1EditingDone(Sender: TObject); |
112 |
|
begin |
113 |
< |
with StringGrid1, IBValidationService1 do |
113 |
> |
with StringGrid1, LimboTransactionValidation do |
114 |
|
if col = 7 then |
115 |
|
begin |
116 |
|
if Cells[7,row] = 'Commit' then |
124 |
|
procedure TLimboTransactionsForm.DoRefresh(Data: PtrInt); |
125 |
|
var i: integer; |
126 |
|
begin |
127 |
< |
with IBValidationService1 do |
127 |
> |
with LimboTransactionValidation do |
128 |
|
begin |
129 |
|
Active := true; |
130 |
|
ServiceStart; |
187 |
|
|
188 |
|
procedure TLimboTransactionsForm.RunGFix; |
189 |
|
begin |
190 |
< |
with IBValidationService1 do |
190 |
> |
with LimboTransactionValidation do |
191 |
|
begin |
192 |
< |
Form1.Memo1.Lines.Add('Starting Limbo transaction resolution'); |
192 |
> |
MainForm.Memo1.Lines.Add('Starting Limbo transaction resolution'); |
193 |
|
FixLimboTransactionErrors; |
194 |
|
while not Eof do |
195 |
|
begin |
196 |
< |
Form1.Memo1.Lines.Add(GetNextLine); |
196 |
> |
MainForm.Memo1.Lines.Add(GetNextLine); |
197 |
|
Application.ProcessMessages; |
198 |
|
end; |
199 |
< |
Form1.Memo1.Lines.Add('Limbo Transaction resolution complete'); |
199 |
> |
MainForm.Memo1.Lines.Add('Limbo Transaction resolution complete'); |
200 |
|
Application.QueueAsyncCall(@DoRefresh,0); |
201 |
|
end; |
202 |
|
end; |