Subject RE: [IBO] Cachedupdates with insert and edit of multiple rows
Author IBO Support List
If you call Dataset.CommitUpdates and you haven't actually performed a
commit then you are putting your updates into an ambiguous state and more or
less causing the updates to be cancelled if the transaction ends up being
rolled back for some reason.

You are also not clear on the phrase "disconnect the dataset from database".
What do you mean by that?

Thanks,
Jason

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of amay
Sent: 23 February 2012 03:32 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Cachedupdates with insert and edit of multiple rows

hi,

i'm using Tib_Dataset with CachedUpdates and using Buffered View
(Dataset buffer).
The target is to disconnect the Dataset from database for inserting and
editing rows.
All is working fine with editing of multiple rows, but i've a problem to
edit new inserted row.

The steps are:

1. load some rows in the buffer and show them. (TIB_Query.open,
AutoFetchAll is true, CachedUpdates is true)
2. insert new row ( Dataset.append, modify with Dataset.FieldByName )
3. modify another row ( Dataset.edit, modify with Dataset.FieldByName)
4. modify new row (from step 2) (Dataset.edit, modify with
Dataset.FieldByName)
5. transfer changes and the new row to database (Dataset.ApplyUpdates
and Dataset.CommitUpdates).


So, when i'm inserting a new row, it is not possible to modify that (to
change to the edit mode is not possible), before inserted row will
posted with Dataset.post or Dataset.ApplyChanges.
If I'm using Dataset.post, it is possible to change to the edit state
and to modify data, but changes (which were made in edit mode) are not
be applied to database after ApplyUpdates and CommitUpdates are called.
If DataSet.ApplyUpdates will called after new row was inserted, we have
same behavior (changes are not be applied to database after ApplyUpdates
and CommitUpdates are called).