Subject Re: [ib-support] Locking records with IBX
Author Jason Wharton
It is probably because you are using autocommit and it makes no sense to
perform the dummy update if it is just going to be autocommitted. IBO's
autocommit and PessimisticLocking property will automate this for you. I
suggest you give it a look.

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Sandeep" <sandeep@...>
To: <ib-support@egroups.com>
Sent: Wednesday, December 20, 2000 3:16 PM
Subject: Re: [ib-support] Locking records with IBX


> On 20 Dec 2000, at 16:20, Ann W. Harrison wrote:
>
> > Why do you want to lock the record?
> If 2 users start to edit a bill with 20 items and they change entries
> in 20 record and when they try to post it the system comes up with
> an error message that someone else has changed it, that will
> definately make him grumble. That's why I need to lock the record.
>
> The way to do it is to
> > update it first, then read it. Something like: update foo set pk = pk;
>
> I use an single IBTansaction with IBTable, which is also default
> IBDatabase Transaction. The transaction is active by default.
>
> This is the code:
>
> procedure TForm1.CFLIBTable1BeforeEdit(DataSet: TDataSet);
> begin
> ibsqlUpdateBeforeEdit.ExecQuery;
> end;
>
> The SQL for ibsqlUpdateBeforeEdit is:
>
> UPDATE CUSTOMER SET
> CUSTOMER = ?CUSTOMER,
> CONTACT_FIRST = ?CONTACT_FIRST,
> CONTACT_LAST = ?CONTACT_LAST,
> PHONE_NO = ?PHONE_NO,
> ADDRESS_LINE1 = ?ADDRESS_LINE1,
> ADDRESS_LINE2 = ?ADDRESS_LINE2,
> CITY = ?CITY,
> STATE_PROVINCE = ?STATE_PROVINCE,
> COUNTRY = ?COUNTRY,
> POSTAL_CODE = ?POSTAL_CODE,
> ON_HOLD = ?ON_HOLD
> WHERE
> CUST_NO = ?OLD_CUST_NO
>
> This doesn't seem to lock the record.
>
> Sandeep
>
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>