Subject Re: [IBO] Problem with Append in a IBOTable
Author Helen Borrie
At 12:26 PM 30-08-01 +0000, you wrote:
>--- In IBObjects@y..., Helen Borrie <helebor@d...> wrote:
> > At 10:39 AM 30-08-01 +0000, you wrote:
> > >Hi
> > >I have a big problem with Append in a IBOTable
> > >I use IBO 3.6 Dg (demo) because I would like convert my
>application
> > >from DBF to IBO.
> > >I use IBOTable with PessimisticLock = TRUE
> >
>
> PessimisticLockING does not apply to Appends. what you mean ??

PessimisticLocking is a property of the underlying TIB_Dataset. It comes into effect only in edits - when you begin to edit your dataset, the rows you edit are given a "dummy update" which causes them to be unavailable to any other transactions which want to update that row.

It doesn't apply to Inserts (Appends) because the rows don't exist.


> IboTable1.PessimisticLock := TRUE;
>
> For me is neccessary!!!!

Why do you think so? IB Transaction control normally provides sufficient isolation.

> > Questions:
> >
>
>Are you getting any error messages, such as "ID is a required field" ?
> YES!!!

Delphi "knows" that your ID column has a NOT NULL constraint. You have to find a way to provide a value for it before posting, because Delphi doesn't know about your trigger. Set your GeneratorLinks for this column, and IBO automatically brings the value into that field for you ---> no more errors.

The trigger will not be used by the application but it should remain there, as a safeguard in case somebody tries to enter data interactively.

> >
> Have you set KeyLinks for the table?
> How?? Post me an example , please

Simply enter this into the KeyLinks property:

ID

>
> >
> Have you set GeneratorLinks for the table?
> How?? Post me an example , please

See Svein's posting.

>
> How can you tell that the trigger is not firing?
> what you mean ??

The trigger never fires on the client side, always only on the server, ** after ** the row has been posted. If the new row does not reach the server, the trigger will not fire. Your Append never goes to the server, because of the "Required field" error. You will cure this by using GeneratorLinks.

Regards,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________