Subject Re: [IBO] Cursors, session props and TIBOxxx
Author Jason Wharton
Couple of problems.

First of all, why and where in code are you directly changing the
Screen.Cursor. You shouldn't have to do this at all.

Second of all, is your session linking clean? It seems to me that you
probably don't have your modules setup in a way that they data access
components are tied to the explicit TIB_Session you have put in your
application. Are you all in code or in data modules?

Components resolve their session upon creation. Thus, sessions have to be
created first and either be used as the owner of subsequent data access
components or share a common owner. Since you are using a nil owner for the
session this isn't going to work well, unless you are making the queries,
etc. owned by the session. Where is your code to create their instances?

Also, you can call the TIBOQuery.BeginBusy( ) and it will link to its owning
session. You don't have to do anything with the session components directly.
But, you problem is more foundational than this. Just remember this for GUI
based apps that aren't so involved as what you appear to be doing.

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


----- Original Message -----
From: "Martijn Tonies" <m.tonies@...>
Newsgroups: egroups.ibobjects
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, January 15, 2002 12:50 PM
Subject: Re: [IBO] Cursors, session props and TIBOxxx


> Hi,
>
> > > I'm currently using TIB_Connection, some TIB_Session and TIBOQuery.
> > >
> > > Whenevery I use the BeginBusy or BeginLockCursor, the cursor still
> > > flickers like a madman whenever I issue a couple of queries.
> > >
> > > When I replace TIBOQuery with TIB_Query, this problem is removed
> > > and the cursor stays solid crWait...
> > >
> > > However, TIB_Query is, at this moment, not a component that I can
use...
> > >
> > > Am I doing something wrong or is there a bug in TIBOQuery?
> >
> > Show us the code.
>
> Eh, what exactly?
>
> The way I'm doing things now is:
>
> Screen.Cursor := crHourGlass;
> then, via some other methods:
> (SessionProps)sp.BeginBusy(False);
> (Session)ses.BeginLockCursor; // I also tried it without the sessionprops
> component
>
> Session is initialized as:
> ses := TIB_Session.Create(nil);
> ses.AllowDefaultConnection := False;
> ses.AllowDefaultTransaction := False;
> ses.BusyCursor := -11;
> ses.YieldCursor := -11;
> ses.UseCursor := True;
>
> then, several queries are executed in a TIBOQuery component, some SELECTs,
> a DROP, CREATE and some GRANTs. -- this is where the cursor flickers,
> if I replace the component by a TIB_Query, it doesn't flicker.
>
> after that, it's:
>
> ses.EndLockCursor;
> sp.EndBusy;
> Screen.Cursor := crDefault;
>
> That's about it...
>
>
> --
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
> Upscene Productions
> http://www.upscene.com
>
> "This is an object-oriented system.
> If we change anything, the users object."
>