Subject Re: [IBO] Cursors, session props and TIBOxxx
Author Martijn Tonies
Hi,

> Couple of problems.

thanks :)

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

It's a thing I do for every 'lengthy' operation. The calling of the session
methods are part of my WaitCursor procedure...

> 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?

Everything is in code, no datamodules or design time created
components. No linking them together or anything like that.

> 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?

Currently (trying to resolve this), I'm creating all TIB<somethings> via the
CreateForSession contructor -> TIBOQuery doesn't seem to have one.
This seems to work fine for all TIB_<somethings>, but not for TIBOQuery.

> 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.

I think the session is the only place where I can set this cursor thingy for
all
(several) query components at the same time. I cannot call
TIBOQuery.BeginBusy, cause several of these are created and in use for the
operations mentioned.

> 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.

Still want to remove the cursor flicker though :) :)


--
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."




> > > > 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...