Board index » delphi » IBX components vs BDE components !

IBX components vs BDE components !

Hello,

I noticed that when I display datas from a TQuery in a DBGrid only the
records displayed in the grid are really fetched from the database server
(interbase). When I press PgDn, the next records are then fetched (the
cursor becomes an SQL cursor) and so on as I move in the query. It's
perfect, especially in RAS.

But what about TIBQuery, the interbase express component ? When I use this
component for the above example, it seems that ALL records are fetched from
the database server when I open the query. What happens exactly ? Is there
any documentation about that ?

Thanks for your help.

Bernard.

 

Re:IBX components vs BDE components !


"Bernard Lahaque" wrote :

Quote
> Hello,

> I noticed that when I display datas from a TQuery in a DBGrid only the
> records displayed in the grid are really fetched from the database server
> (interbase). When I press PgDn, the next records are then fetched (the
> cursor becomes an SQL cursor) and so on as I move in the query. It's
> perfect, especially in RAS.

> But what about TIBQuery, the interbase express component ? When I use this
> component for the above example, it seems that ALL records are fetched
from
> the database server when I open the query. What happens exactly ? Is there
> any documentation about that ?

The records of the interbase table will be selected from the server only
when you open the query and than will be stored locally in the client
buffers.
So if you want to refresh the records in the grid you must reselect those
records reopening the query.

If you want you can substitute the TibQuery component with TibDataSet
component and in the afterscroll method you can call the refresh method to
refresh every record of the interbase table but this can be slow.

Massimo.

Re:IBX components vs BDE components !


Quote
Bernard Lahaque wrote:

> Hello,

> I noticed that when I display datas from a TQuery in a DBGrid only the
> records displayed in the grid are really fetched from the database server
> (interbase). When I press PgDn, the next records are then fetched (the
> cursor becomes an SQL cursor) and so on as I move in the query. It's
> perfect, especially in RAS.

> But what about TIBQuery, the interbase express component ? When I use this
> component for the above example, it seems that ALL records are fetched from
> the database server when I open the query. What happens exactly ? Is there
> any documentation about that ?

This is the same in IBX.  IBX only fetches records when you or a data aware
control requests it if it is not already locally buffered.  Grids only ask for
what they need to display.  A quick look with the IBSQLMonitor will prove this
out, scrolling the grid does indeed fetch more records.

Quote
> Thanks for your help.

> Bernard.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The fool escaped from paradise will look over his shoulder and cry
Sit and chew on daffodils and struggle to answer why?
As you grow up and leave the playground
Where you kissed your Prince and found your frog
Remember the jester that showed you tears, the script for tears. (Fish)

Re:IBX components vs BDE components !


Jeff Overcash (TeamB) <overc...@onramp.net> a crit dans le message :
39D1FDF3.39A23...@onramp.net...

Quote

> Bernard Lahaque wrote:

> > Hello,

> > I noticed that when I display datas from a TQuery in a DBGrid only the
> > records displayed in the grid are really fetched from the database
server
> > (interbase). When I press PgDn, the next records are then fetched (the
> > cursor becomes an SQL cursor) and so on as I move in the query. It's
> > perfect, especially in RAS.

> > But what about TIBQuery, the interbase express component ? When I use
this
> > component for the above example, it seems that ALL records are fetched
from
> > the database server when I open the query. What happens exactly ? Is
there
> > any documentation about that ?

> This is the same in IBX.  IBX only fetches records when you or a data
aware
> control requests it if it is not already locally buffered.  Grids only ask
for
> what they need to display.  A quick look with the IBSQLMonitor will prove
this
> out, scrolling the grid does indeed fetch more records.

I made the test with an SQLMonitor. There is indeed a fetch each time the
display in the grid change. But I made this other test :
1. Display the grid. The current record is the first of the query.
2. I change the last record of the query (which is not displayed in the
grid) externally with Database explorer.
3. I go to the last record using the scroll bar.
and ... the record is not the updated one !!!
On the other hand, I made the test with BDE component TQuery and it works
fine : the last record in the grid is updated.

Can you explain that, Jeff ?

Thanks for your help.

Re:IBX components vs BDE components !


Quote
Bernard Lahaque wrote:

> I made the test with an SQLMonitor. There is indeed a fetch each time the
> display in the grid change. But I made this other test :
> 1. Display the grid. The current record is the first of the query.
> 2. I change the last record of the query (which is not displayed in the
> grid) externally with Database explorer.
> 3. I go to the last record using the scroll bar.
> and ... the record is not the updated one !!!
> On the other hand, I made the test with BDE component TQuery and it works
> fine : the last record in the grid is updated.

> Can you explain that, Jeff ?

What is the transaction level for your query?  Proably is not ReadCommitted.

Quote
> Thanks for your help.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The fool escaped from paradise will look over his shoulder and cry
Sit and chew on daffodils and struggle to answer why?
As you grow up and leave the playground
Where you kissed your Prince and found your frog
Remember the jester that showed you tears, the script for tears. (Fish)

Re:IBX components vs BDE components !


Jeff Overcash (TeamB) <overc...@onramp.net> a crit dans le message :
39D226A0.D202E...@onramp.net...

Quote

> Bernard Lahaque wrote:

> > I made the test with an SQLMonitor. There is indeed a fetch each time
the
> > display in the grid change. But I made this other test :
> > 1. Display the grid. The current record is the first of the query.
> > 2. I change the last record of the query (which is not displayed in the
> > grid) externally with Database explorer.
> > 3. I go to the last record using the scroll bar.
> > and ... the record is not the updated one !!!
> > On the other hand, I made the test with BDE component TQuery and it
works
> > fine : the last record in the grid is updated.

> > Can you explain that, Jeff ?

> What is the transaction level for your query?  Proably is not
ReadCommitted.

How can I set the TransIsolation property ? It doesn't exists with IBX...

- Show quoted text -

Quote
> > Thanks for your help.

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> The fool escaped from paradise will look over his shoulder and cry
> Sit and chew on daffodils and struggle to answer why?
> As you grow up and leave the playground
> Where you kissed your Prince and found your frog
> Remember the jester that showed you tears, the script for tears. (Fish)

Re:IBX components vs BDE components !


Bernard Lahaque <q...@swing.be> a crit dans le message : 39d2fcc2_1@dnews...

Quote

> Jeff Overcash (TeamB) <overc...@onramp.net> a crit dans le message :
> 39D226A0.D202E...@onramp.net...

> > Bernard Lahaque wrote:

> > > I made the test with an SQLMonitor. There is indeed a fetch each time
> the
> > > display in the grid change. But I made this other test :
> > > 1. Display the grid. The current record is the first of the query.
> > > 2. I change the last record of the query (which is not displayed in
the
> > > grid) externally with Database explorer.
> > > 3. I go to the last record using the scroll bar.
> > > and ... the record is not the updated one !!!
> > > On the other hand, I made the test with BDE component TQuery and it
> works
> > > fine : the last record in the grid is updated.

> > > Can you explain that, Jeff ?

> > What is the transaction level for your query?  Proably is not
> ReadCommitted.

> How can I set the TransIsolation property ? It doesn't exists with IBX...

Sorry this can be done in the params property. I checked ReadCommited but it
does not work better !

- Show quoted text -

Quote

> > > Thanks for your help.

> > --
> > Jeff Overcash (TeamB)
> >       (Please do not email me directly unless  asked. Thank You)
> > The fool escaped from paradise will look over his shoulder and cry
> > Sit and chew on daffodils and struggle to answer why?
> > As you grow up and leave the playground
> > Where you kissed your Prince and found your frog
> > Remember the jester that showed you tears, the script for tears. (Fish)

Re:IBX components vs BDE components !


Quote
Bernard Lahaque wrote:

> How can I set the TransIsolation property ? It doesn't exists with IBX...

Double click the IBTransaction component or fill out the params property.

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The fool escaped from paradise will look over his shoulder and cry
Sit and chew on daffodils and struggle to answer why?
As you grow up and leave the playground
Where you kissed your Prince and found your frog
Remember the jester that showed you tears, the script for tears. (Fish)

Other Threads