Subject | RE: [IBO] How to retain iboControl values after rollback? |
---|---|
Author | Alan McDonald |
Post date | 2003-02-07T21:07:20Z |
you will, however, loose any generator increments your attempt to post has
caused
Alan
-----Original Message-----
From: Lucas Franzen [mailto:luc@...]
Sent: Saturday, 8 February 2003 12:40 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] How to retain iboControl values after rollback?
"Michael Fung " schrieb:
Example:
procedure SaveData;
begin
with qry do
begin
try
POST; (1)
IB_Transaction.Commit; (2)
except
end;
end;
end;
When you post your query (1) the data is sent to the server, thus the
triggers will be executed. Since one of them fails the post will fail,
too, thus your query will REMAIN in mode dssInsert or dssEdit and the
IB_Transaction.Commit (2) won't be executed, since the post (1) will
cause the exception.
Nothing could be posted so nothing has to be rolled back.
(Always keep in mind that the triggers run within the same
trannsaction.)
Regards
Luc.
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
caused
Alan
-----Original Message-----
From: Lucas Franzen [mailto:luc@...]
Sent: Saturday, 8 February 2003 12:40 AM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] How to retain iboControl values after rollback?
"Michael Fung " schrieb:
>No, you don't have to roll it back.
> Luc,
>
> Let me use an example.
>
> 1. client call query.post to insert a record to table A
> 2. after insert trigger (AI) of table A fire up,
> 3. AI insert a record to table B,
> 4. then AI also insert a record to table C, but that failed and an
> exception is raised
> 5. the exception propagate to my client side application
>
> If I do not rollback, changes to table A and B will not be undone if
> I commit later. Am I right? Or, IBO will automatically rollback upon
> exception?
Example:
procedure SaveData;
begin
with qry do
begin
try
POST; (1)
IB_Transaction.Commit; (2)
except
end;
end;
end;
When you post your query (1) the data is sent to the server, thus the
triggers will be executed. Since one of them fails the post will fail,
too, thus your query will REMAIN in mode dssInsert or dssEdit and the
IB_Transaction.Commit (2) won't be executed, since the post (1) will
cause the exception.
Nothing could be posted so nothing has to be rolled back.
(Always keep in mind that the triggers run within the same
trannsaction.)
Regards
Luc.
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/