Subject | Re: TIBOTable.Locate problem |
---|---|
Author | remk_1 |
Post date | 2003-03-17T09:04:53Z |
I don't expect it has something to do with transactions. The test
table was filled (and committed) in different application and the
data are apparently there. I see them in IBConsole and the BDE can
locate any record. Also, if it was transaction problem why would it
help to change DefaultNoTrimming to true ? I suspect the problem lies
somewhere in horizontal refinement and the way it locates for
records. I found through IB_Monitor that after the first
unsuccessfull locate there is a fetchall from position of the
searched record to the end of the table and consecutive locate is
already successfull (as it locates in memory buffers, I suppose).
There are just the two components in my test IBO application -
TIBODatabase and TIBOTable. All their settings were left on default
values except those mentioned in my previous message. No transaction
setting was altered - default Isolation of TIBODatabase is
tiCommitted. I use evaluation version of IBO (4.2Ib) and Interbase OS
6.0.1.0. for the test.
Michal
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
table was filled (and committed) in different application and the
data are apparently there. I see them in IBConsole and the BDE can
locate any record. Also, if it was transaction problem why would it
help to change DefaultNoTrimming to true ? I suspect the problem lies
somewhere in horizontal refinement and the way it locates for
records. I found through IB_Monitor that after the first
unsuccessfull locate there is a fetchall from position of the
searched record to the end of the table and consecutive locate is
already successfull (as it locates in memory buffers, I suppose).
There are just the two components in my test IBO application -
TIBODatabase and TIBOTable. All their settings were left on default
values except those mentioned in my previous message. No transaction
setting was altered - default Isolation of TIBODatabase is
tiCommitted. I use evaluation version of IBO (4.2Ib) and Interbase OS
6.0.1.0. for the test.
Michal
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
> This came up for someone not too long ago and they found out theirdifferent
> transaction isolation settings were off or that they were in a
> context (transaction).to
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
> -- We may not have it all together --
> -- But together we have it all --
>
>
> ----- Original Message -----
> From: "remk_1" <remk_1@y...>
> To: <IBObjects@yahoogroups.com>
> Sent: Friday, March 14, 2003 4:09 AM
> Subject: [IBO] TIBOTable.Locate problem
>
>
> > Hi,
> >
> > I have a problem with Locate method not finding a record which I
> > believe it should find (BDE has no problem to Locate it). I'm new
> > IBO so may be I'm doing something wrong but the problem is evidentare
> > even on a simple testing application with just one table and one
> > database component:
> >
> > When I create a simple table like this
> >
> > CREATE TABLE TEST
> > (
> > TESTFLD CHAR(10) NOT NULL,
> > CONSTRAINT TEST_PK PRIMARY KEY (TESTFLD)
> > );
> > CREATE DESCENDING INDEX TEST_D ON TEST(TESTFLD);
> >
> > and fill it with some data (for example left alligned strings
> > from '1' to '1000') the Locate method of TIBOTable fails to find
> > existing record.
> >
> > The problem disappears if I do one of the following:
> > - set IBOTable.AutoFetchAll to true OR
> > - set IBOTable.AllowHorizontalRefinement to false OR
> > - set DefaultNoTrimming to true
> >
> > It also works OK if the table contains just a few records so they
> > all buffered (the locate method works on condition the searchedcan't
> > record is nearby active record).
> >
> > In real application which I would convert from BDE, however, I
> > use any of these workarounds and I would expect the samebehaviour as
> > had the BDE, which is to find the record.
> >
> > In the test application I use the following component settings:
> >
> > IBODatabase1:
> > DatabaseName: DbName
> > Username: sysdba
> > Password: masterkey
> > Protocol: cpTCP_IP
> > Server: localhost
> > Path: D:\TESTDB.GDB
> >
> > IBOTable1:
> > DatabaseName: DbName
> > TableName: TEST
> > IndexFieldName: TESTFLD
> > Keylinks: TESTFLD
> >
> > procedure TForm1.Button1Click(Sender: TObject);
> > begin
> > IBOTable1.Open;
> > if IBOTable1.Locate('TESTFLD', '123', []) then
> > ShowMessage('Found')
> > else
> > ShowMessage('Not Found');
> > IBOTable1.Close;
> > end;
> >
> > What's wrong with it ?
> >
> > Michal