Subject | Re: Strange behavior of 2 TIB_Cursor |
---|---|
Author | ac.hi@switzerland.org |
Post date | 2001-05-24T17:21:33Z |
Thanks for your help!
(which is started explicit) - the only thing they share. I havent set
any master detail relationship between the two or something similar.
Isolation level is tiCommitted - but I think that shouldn't matter as
I'm testing my programme in an evironment with only one user - the one
who is reading the database with the cursors.
I still don't understand why the different result of the cursor is
changing depending on which one I open first. That looks really
strange to me.
Daniel Achermann
> >>same
> Yes: you need to put these two datasets under the control of the
> transaction and start that transaction before you call Open (orFirst) on
> the ib_cursors. Make sure the Isolation level is tiCommitted.there
> <<
>
> I would think tiConcurrency would be more appropriate. Otherwise,
> could be different results from the actions of other users.Both cursor are sharing the same connection and same transaction
(which is started explicit) - the only thing they share. I havent set
any master detail relationship between the two or something similar.
Isolation level is tiCommitted - but I think that shouldn't matter as
I'm testing my programme in an evironment with only one user - the one
who is reading the database with the cursors.
I still don't understand why the different result of the cursor is
changing depending on which one I open first. That looks really
strange to me.
> Also, rather than walking two cursors I would make the second oneoperate
> off a parameter from the first one.call the
> In the Cursor1.After FetchRow event plug in the input parameter and
> First method for cursor 2.I guess that's a solution but not an explanation for the problem.
> Then your loop would look like this:
>
> cursor1.First;
> while not cursor1.Eof do begin
> do several things
> cursor1.Next;
> end;
>
Daniel Achermann
> >I have the following problem:connection
> >
> >I create two TIB_Cursor at runtime, set the properties for
> >and add a SQL-Command. The command is similar for both, it shouldlike
> >return records with the same ID but different fields, something
> >is
> > SELECT PersonID, Fld1, Fld2, Fld3
> > FROM Person
> > ORDER BY PersonID
> >
> > and
> >
> > SELECT PersonID, Fld4, Fld5, Fld6
> > FROM Person
> > ORDER BY PersonID
> >
> >The real Sql-Command is much more complex and is a join of a lot of
> >tables. The reason why I have to split it, is because the command
> >too complex.like
> >
> >Afterwards I want to step through the two cursor. I'm doing that
> >this:Sql-statement.
> >
> > cursor1.First;
> > cursor2.First;
> > while not cursor1.Eof do begin
> > do several things
> > cursor1.Next;
> > cursor2.Next;
> > end;
> >
> >I expect that both cursor have the same records, that means the
> >PersonID should always be the same.
> >
> >But it isn't. One can argue that this is based on the
> >on
> >But the really strange thing is, that I get different results based
> >the order which cursor I open first. When I write the statementsabove
> >different:(amount
> >
> > cursor2.First;
> > cursor1.First;
> > while not cursor1.Eof do begin
> > do several things
> > cursor1.Next;
> > cursor2.Next;
> > end;
> >
> >opening first cursor2, the results is different, other records are
> >missing. The cursor I open first seems to return the correct
> >of) records, but in the second query some records are missing: Thesame
> >first few records seem to be correct but suddenly I have a gap.
> >
> >I'm using:
> > - IBO 3.6Dg
> > - Delphi 5.1
> > - Interbase 6
> >
> >Has anyone an idea what could be the problem about it?
>
>
> Yes: you need to put these two datasets under the control of the
> transaction and start that transaction before you call Open (orFirst) on
> the ib_cursors. Make sure the Isolation level is tiCommitted.
>
> Helen