Subject | Re: [IBO] About post, commit, delete |
---|---|
Author | Helen Borrie |
Post date | 2003-09-21T17:18:19Z |
At 03:39 PM 21/09/2003 +0000, you wrote:
transaction control and you must call Commit. But, if your transaction has
Autocommit true AND you don't call StartTransaction, then the commit will
happen automatically when you call Post. (StartTransaction disables
Autocommit).
If you set BufferSynchroFlags to include bsAfterInsert, then IBO should
take care of bringing the inserted row into the buffer. But it won't work
if your keylinks are wrong, or if IBO doesn't know the new PK of the
row. In that case a Refresh will be needed to make the new row visible.
otherwise you make a lot of unnecessary work for your application
(unnecessary work = wasted time, slower performance)
Helen
>As I understant, post is used when dataset is edited or new recordsYes. If you call StartTransaction in your code then you are in explicit
>are inserted. Such code
>IB_Query->Insert();
>IB_Query->FieldByName( .... )->Assign( .... );
>IB_Query->Post();
>IB_Query->Refresh();
>doesn't insert new records into table (client see newly inserted
>records). I must commit in order to post new records into table?
transaction control and you must call Commit. But, if your transaction has
Autocommit true AND you don't call StartTransaction, then the commit will
happen automatically when you call Post. (StartTransaction disables
Autocommit).
If you set BufferSynchroFlags to include bsAfterInsert, then IBO should
take care of bringing the inserted row into the buffer. But it won't work
if your keylinks are wrong, or if IBO doesn't know the new PK of the
row. In that case a Refresh will be needed to make the new row visible.
>What to do in delete case (IB_Query->Delete() )?Just call Refresh. IBO will take care of closing and opening.
>IBO help states, that commit closes dataset - I need to reopen
> then toNo, don't call Prepare. IBO will prepare datasets if it is needed,
>see changes (prepare
otherwise you make a lot of unnecessary work for your application
(unnecessary work = wasted time, slower performance)
> & then open)?Only Refresh. After starting the transaction, of course.
Helen