Subject RE: [IBO] IBOQuery with record locking
Author Paul Hope
Hi Earnest

If you are saying the second user cannot see the existing data (you get a
lock conflict) then however you are viewng that data is demanding a lock.
Your viewing setup must be going into update mode, or trying to lock the
records, when it doesnt need to.

IBOQuery should only discover a lock when you commit changes to a row, not
on reading the rows. It should be no different from viewing in EMS.

There must be something strange about your setup or components

Paul

> -----Original Message-----
> From: IBObjects@yahoogroups.com
> [mailto:IBObjects@yahoogroups.com] On Behalf Of earnesttse
> Sent: 20 March 2008 07:10
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] IBOQuery with record locking
>
> If turn off LockWait, in this case, I will get error: ISC
> ERROR CODE:335544569; ISC ERROR MESSAGE:Dynamic SQL Error,
> SQL error code=- 504, Invalid cursor reference, Cursor is not open.
>
> It seems the IBOQuery of other user knows that the record was locked.
>
> My problem is that if one user edited a detail record of
> first master record and don't commit yet, there is no other
> user can open the query of detail table.
>
> I tried to use [EMS InterBase & FireBird Manager 3] to veiw
> the data which edited and posted in a transcation (before
> commit or rollback), I can see the old verson of the record
> without error.
>
> Thanks for help!
>
> Earnest
>
>
> --- In IBObjects@yahoogroups.com, "Jason Wharton" <supportlist@...>
> wrote:
> >
> >
> > 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
> >
>
>
>
> ------------------------------------
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> ! Yahoo! Groups Links
>
>
>