Subject RE: [IBO] IBOQuery with record locking
Author Jason Wharton
Turn LockWait off.

This should not be used in an interactive GUI application.

The transactions will isolate everything fine without LockWait.

Jason Wharton

> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of earnesttse
> Sent: Wednesday, March 19, 2008 8:18 PM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] IBOQuery with record locking
>
>
> Dear Helen,
>
> Thanks for detail explain!
>
> My problem is that when a detail was edited and posted in a
> Transaction, the second user still can't to read "latest commited"
> version of the record. When LockWait=True, the application of second
> user will be hold to wait the transaction of first user to commit or
> rollback; when LockWait=False, the application of second user will
> raise record locking error.
>
> I want to allow another user can read the record which was edited and
> posted in a uncompleted transaction without waiting or error.
>
> Thanks for help!
>
> Earnest
>
> --- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
> >
> > At 01:00 PM 20/03/2008, you wrote:
> > >Hello, I have a record locking problem needing your help!
> >
> > I am using Delphi 2007, IBO 4.8.7, IBOQuery, AutoCommit=True,
> > Isolation=tiCommitted.
> >
> >
> > >I have master/detail tables to record sale invoice. I call
> > >IB_Database.StatTransaction before editing master reocrd. When one
> > >user is editing a record of detial, other user can't read the
> edited
> > >record, system will wait until the record has been cancelled or
> > >posted.
> >
> > Transactions cannot see work that other transactions are doing.
> Fb/IB do not support "dirty read" so, even when the first transaction
> (A) posts the work that results from an Edit, other transactions will
> not see those changes. If the other transactions are viewing the
> table with ReadCommitted isolation, they will see the changes of
> Transaction A only after Transaction A has committed. If Transaction
> A does not commit, but rolls back instead, other transactions will
> NEVER see those changes.
> >
> > Whilst TrxA is reading the record (XYZ), other records can read
> the "latest committed" version of that record.
> > --- during Editing, nothing changes on the database side
> > --- at Post, the dataset sends a DML statement to the server. If
> no other transactions already have uncommitted changes posted for
> that record, Trx A gets the lock. Other transactions can still see
> the latest committed version, as before, but none will be allowed to
> post changes to that record.
> >
> > If TrxA actually INSERTs the record in question, it does not exist
> for other transactions to see until that INSERT is committed by
> TrxA. If it is true that you have other users that cannot see ANY
> version of record XYZ while TrxA is Editing it, then the reason will
> be that TrxA itself inserted the record.
> >
> > >Is there any way to allow the second user to view the edited
> record