Re: [gnome-db] API change for GdaConnection



On Tue, 22 Mar 2005 11:55:00 +0100, Rodrigo Moya <rodrigo gnome-db org> wrote:
> On Mon, 2005-03-21 at 15:03 +0100, Vivien Malerba wrote:
> > Hi!
> >
> > I've looked into all the providers and realized that the
> > "GdaParameterList *params" argument of the
> > gda_connection_execute_command() method is never used, so I propose to
> > remove it, as there is also no documentation for its usage (which is
> > normal considered it's never used).
> >
> if we remove it, we need to think about a way for using parametrised
> commands. That's the only purpose of the GdaParameterList. I guess we
> could just do it at the GdaCommand level.

Yes. Also I noticed that parametrised commands are not implemented
(there is a /*FIXME*/ in the gda_sql_replace_placeholders() function,
which BTW is never used in libgda), which means this functionnality is
not used at all.

There are two possibilities about that then:
1- implemente that function, and make sure it's used everywhere where
appropriate
2- Remove that functionnality from libgda and use the same
functionnality provided by libgnomedb (which works).

I'd vote for the 2nd choice.

> 
> > This is a starting point in improving the libgda API useability.
> >
> > I'm also planning to add asychronous query execution to be able to
> > have more responsive GUI applications. I'll submit a proposal API
> > before any actual implementation.
> >
> that is a very good idea.

Yes, I think it's really something missing. The problem I have at the
moment is how to cope with transactions correctly, and I have no
solution at the moment.

About transactions, I think the gda_client_*_transaction() methods are
dangerous to use as it does not guarantee anything even though it lets
the user suppose that he will benefit from a global transaction on all
the connections the client has. It also does not grarantee that when
gda_client_begin_transaction() is successfully called, the contents of
the database is strictly the same for all the connections (as it's not
an atomic operation from the database point of view). So I propose to
remove the  gda_client_*_transaction() methods altogether. What do you
think?

That's quite a lot of changes, but I think they are necessary to have
a better API.

Cheers,

Vivien



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