Re: [gnome-db] Questions about a possible asynchronous gda behaviour



El vie, 14-11-2003 a las 16:46, Rodrigo Moya escribió:
> On Tue, 2003-11-11 at 16:54, Gonzalo Paniagua Javier wrote:
> > El mar, 11-11-2003 a las 12:50, David Marín Carreño escribió:
> > > Hi.
> > > 
> > > I'd like to know what is the gda behaviour while querying a PostgreSQL
> > > server. 
> > > 
> > > Is it asynchronous? That is: the query is launched with
> > > "gda_connection_execute_single_command", but this function returns after
> > > making the query, without waiting for the datamodel to be filled with
> > > the real data. The application should block when trying to access to
> > > datamodel rows not filled yet, and should unblock when these rows get
> > > the real data.
> > 
> > No, it's not.
> > 
> it's not asynchronous, but rows are fetched on demand, when the app
> requests them. So, when you execute a comand, you get the pointer to the
> recordset, and the provider fetches the rows when requested, not in
> advance.
> 
> > > 
> > > I don't know if this is the actual behaviour, but if it isn't, IMHO, I
> > > think it's a necessary feature: when a program has to show a very long
> > > list of data, I cannot wait until having all the rows before starting to
> > > show the first of them.
> > > 
> > > I know that PostgreSQL, with libpq, support this behaviour
> > > (http://www.postgresql.org/docs/7.3/interactive/libpq-async.html), where
> > > you make a query, and then ask libpq for data a lot of times until all
> > > the data has been sent.
> > 
> > We may add an option to GdaCommandOptions that tells the provider we
> > want async processing. Then we have to add a function to be called when
> > the system is idle that reads any data available and stores it in the
> > GdaDataModel you get. The connection is locked for anything else while
> > this has not finished.
> > 
> hmm, IIRC, the postgres provider fetches the rows when it's requested to
> do so, one by one. Or am I wrong Gonzalo?

Yes, but it does not use the async interface from postgres. If you
request row 1000, it will fetch all the needed rows blocking in get_rows
until it gets 1000.

I think that David may want something like get_row_async and hook a
callback to row-inserted signal of GdaDataModel.

-Gonzalo





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]