Re: UpdateBatch Problem

From: Kevin Frevert (kevin_at_workdrinkingcoffee.com)
Date: 10/09/03


Date: Thu, 9 Oct 2003 07:41:01 -0500

winsoft,

  Just curious, is there a specific reason for using explicit transactions?
Have you tried letting ADO handle the transaction implicitly? This is just
a guess, ADO processes each record in the 'batch' independently, but within
it's implicit transaction handler. According to the cache:
- The first two were successful (removed from it's delta or internal change
log)
- Last one failed, called it's rollback for that record
- Your RollBackTrans, rolled everything back on the server (internal cache
handler has no idea that happened).

You could either try not using explicit transaction or if letting ADO
handle the transaction details is not an option, refresh the query on an
exception

Good luck,
krf

"winsoft" <winsoft@sby.dnet.net.id> wrote in message
news:3f852396@newsgroups.borland.com...
> I've problem with updatebatch while RollBackTrans issued.
> I'm using TADOQuery with CursorLoc = Client, CursorType = Static, LocType
=
> BatchOptimistic.
>
> Lets say that I just input 3 new data into TADOQuery, but one of the data
is
> not valid (ex : stock is not enough, etc).
> Then I Save the data using the following procedure :
>
> ADOConnection.BeginTrans;
> Try
> ADOQuery.UpdateBatch();
> ADOConnection.CommitTrans;
> Except
> ADOConnection.RollBackTrans;
> End;
>
> And the error exception is raised, so I have to fix the invalid data and
try
> to save the data again using the procedure above.
> The question is : After saving the data, why not all data are save to the
> database, but just only one data.
> (I'm using SQL Server 2000)
>
> Thanks for your help.
>
>
>



Relevant Pages

  • Re: Transactions.
    ... > connection to use EXPLICIT TRANSACTIONS with SQL SERVER. ... CommitTrans or RollbackTrans of a ADO ... This is from my SQL Server 2000 Books online on "Explicit Transactions". ... ITransactionLocal::StartTransaction method to start a transaction. ...
    (microsoft.public.data.ado)
  • Transaktion mit Access
    ... Bei manchen mehrstufigen Updates und Inserts ... 'adoConnection.BeginTrans'absetzen und nach Abschluss aller Updates ein ... CommitTrans (oder RollBackTrans, bei Fehlern) oder bedarf es dazu ... Bzw die SQL-Kommandos BEGIN TRANSACTION, ...
    (microsoft.public.de.access)
  • Re: Transactions and foreign keys
    ... SQL Server handles explicit transactions differently than Access/Jet. ... You need to perform the insert into the parent, ... What I am using is an OleDbConnection / Transaction, ...
    (microsoft.public.dotnet.framework.adonet)
  • Error using Transaction
    ... In the VBA code of a Form callback function: ... when execution reaches 'RollbackTrans', ... 'You tried to commit or rollback a transaction without first ...
    (microsoft.public.access.modulesdaovba)
  • Re: Tracking Notes
    ... Make sure that if you're using transactions, ... Used to initiate and conclude explicit transactions. ... Conclude a transaction by committing all work performed during the ... so that partial updates do not ...
    (comp.databases.ms-access)