Re: UpdateBatch Problem
From: Kevin Frevert (kevin_at_workdrinkingcoffee.com)
Date: 10/09/03
- Next message: George Christoforakis: "Re: Memory Hog"
- Previous message: Richard Gilbert: "Re: Access File Password"
- In reply to: winsoft: "UpdateBatch Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
>
>
>
- Next message: George Christoforakis: "Re: Memory Hog"
- Previous message: Richard Gilbert: "Re: Access File Password"
- In reply to: winsoft: "UpdateBatch Problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|