Re: Transactin and Rollback.



Thanks to all

I resolve the problem. Using one newer connection only for that operation Is
working.
My old connection must commite the first post somewhere.

Is there any tutorial or something about transtions with delphi and ADO?

Vitor

"Vitor Martins" <vitor_martins@xxxxxxxxxxx> escreveu na mensagem
news:47c46045@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi

Why the code below , don´t do a Rollback in the insert in the first
table, DsetStockDoc.?
Only do the Rollback of the inserts in the cicle FOR!

Thanks in advance

Vimar

dtmpri.cnx_cv2.BeginTrans;
dtmpri.cnx_cv2.IsolationLevel:=ilReadCommitted ;
try
dsetStocKDoc.Insert;
....
...
dsetStockDoc.Post;
// a inserting detail
for i:= 1 to sgrid.RowCount - 1 do
begin
dsetStockDoc_detalhe.Insert;
.....
.....
dsetStockDoc_detalhe.post;
end;
dtmpri.cnx_cv2.CommitTrans;
except
on E:Exception do
begin
dtmpri.cnx_cv2.RollbackTrans;
messagedlg( ' Doc not Saved.
ERROR='+e.Message,mtwarning,[mbok],0);
end;
end;



.



Relevant Pages

  • Am I attacked ?
    ... hello to everybody here since this is my first post. ... I am running Sysgate Personal Firewall, ... Now, about myself, I live in France, have a DSL connection and ... amateur when it comes to computers (and a real newbie when it comes to ...
    (comp.security.firewalls)
  • Re: Repost: Unable to contact a DHCP server?
    ... Your first post talking about specifying TCP/IP Address and my search on Help and Support Center about it which resulted finding the link at the end of this message gave us the ability to resolve this issue! ... The goal was to make a network folder to store files, and be able to browse its contents remotely, either by making a temporary network connection via the Run, but neither with Remote Desktop. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Using a Transaction with a SqlDataSource
    ... The return from this stored procedure determines if Icommit or rollback. ... "Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK ... The e.Command.Transaction.Rollbackshould be placed in the scope of the Catch, with a possible check to see if the connection is Open and close the connection before you Throw to leave the routine. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OE6 - broadband - PC startup - unconnected
    ... If so, perhaps I misunderstood you or misread your first post: Is the problem the fact that OE doesn't connect, the fact that the Network Connection icon isn't displaying, or both? ... Do you connect directly via the Speedtouch modem, via a separate router, or wirelessly? ... There is no OE7 or OE8. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Transaction when client shutdown
    ... >> killing a process or dropping a connection. ... >> there is indeed no automati commit or rollback of open transactions. ... >> The transaction remains open and any locks are held until the ... >> Best, Hugo ...
    (microsoft.public.sqlserver.programming)