Subject Re: [IBO] Refresh
Author Sandeep
On 12 Nov 2001, at 9:45, Helen Borrie wrote:

> At 10:59 AM 12-11-01 +1300, you wrote:
> >I have a table and transaction and I have to process few records in
> >it, so I start a transaction using StartTransaction. I make some
> >changes to a record and after posting I refresh the table, and I
> >loose all the changes I made to the record. What could be causing
> >this?
>
> In Paradox, when you Post a dataset, its changes are written to the database. It doesn't have transactions, so Commit doesn't happen.
>
> In InterBase, Post writes the new version of the dataset to the server's cache. For updates and deletes, this causes the "real" row to be locked against other transactions until the transaction in which the dataset changes occurred gets either committed or rolled back.
>
> When your transaction is set to Autocommit, every valid Post from a dataset will cause the transaction to be committed (by CommitRetaining, which holds your cursors open).
>
> When you take explicit control of the transaction by calling StartTransaction, AutoCommit (if set True) becomes suspended for the duration of the transaction. Transactions can be ended only by committing or rolling back.
>
> Hence, if you don't call commit, your transaction stays unresolved...not only do changes not appear to other transactions (since they haven't "happened" yet) but the OAT can't move forward and garbage collection gets suspended as well. So, not only is your uncommitted transaction holding up
the state of your data, it is also compromising the health (and thus performance) of the database for all users. Eventually the server will simply crash.

If I don't refresh after post then with transaction started
(InTransaction = true) I don't loose the changes.

Sandeep

Software Developer
CFL
sandeep@...
http://www.cfl.co.nz