Re: Transaction Problem, part two..
- From: "John Friel" <john@xxxxxxxxxxxx>
- Date: Fri, 17 Nov 2006 14:45:44 -0600
Yet more to the puzzle:
Pseudo Code of problem:
- o - o - o- o - o - o - o -
procedure ProcessOrder;
begin
procedure step1;
procedure step2;
procedure step3;
end;
Procedure DoOrder;
begin
try
Mainform.ADOConnection1.begintrans;
CallProcedureA;
CallProcedureB;
CallProcedureC;
ProcessOrder;
Mainform.ADOConnection1.CommitTrans;
except
on E : Exception do
begin
ShowMessage(E.ClassName+' error raised, with message : '+E.Message);
Mainform.ADOConnection1.RollbackTrans;
end;
end;
PrintInvoice;
SendEmailCopy;
end;
- o - o - o- o - o - o - o -
This fails and acts like everything done was executed as a rollback.
If I move the ProcessOrder call to just before the PrintInvoice call, then
everything works.
I have stepped through all this code line-by-line and nothing is out of the
ordinary. I even went as far as placing a try/except block inside the
ProcessOrder procedure with its own transaction protection and that too is
successful if outside the Main transaction try/except.
I just don't want to split these two sets in seperate transactions. They
should be all done or nothing done.
Do all of the procedures protected by transactions have to reside in the
same Unit?
There has to be a simple reason this is failing and I just can't see it.
(sigh)
John
.
- References:
- Transaction Problem, part two..
- From: John Friel
- Re: Transaction Problem, part two..
- From: Brian Hollister
- Re: Transaction Problem, part two..
- From: John Friel
- Transaction Problem, part two..
- Prev by Date: Re: Transaction Problem, part two..
- Next by Date: trouble creating DSN
- Previous by thread: Re: Transaction Problem, part two..
- Next by thread: Re: Transaction Problem, part two..
- Index(es):
Relevant Pages
|