[gnome-db] Re: Minor API change and MySQL [update/delete]_row



On Mon, 2003-10-27 at 05:17, Paisa Seeluangsawat wrote:
> If it's about transaction, we also have these functions (I've never
> tried them),
> 
>     gda_connection_begin_transaction()
>     gda_connection_commit_transaction()
>     gda_connection_rollback_transaction()
> 
>     gda_client_begin_transaction()
>     gda_client_commit_transaction()
>     gda_client_rollback_transaction()
> 
yes, but not all providers will use transactions for the updating case,
some would use locking, whatever.

> 
> If it's about table/row locking, we probably want a more specific
> function name e.g.
> 
>     gda_data_model_[un]lock_row (GdaDataModel *model, [gint||GdaRow*] row);
>     gda_data_model_[un]lock_table (GdaDataModel *model);
> 
but then this adds confusion, in some cases, since some providers dont
need to lock rows at all.

> 
> If it's about local preparation, gda_data_model_get_updatable_row()
> can detect if it's being called for the first time.  If we have
> _get_updatable_row() return internal GdaRow* like _get_row() does, the
> allocalted memory is big_O(# of rows) and we can wait until
> _finalize() to deallocate it.
> 
well, it's about doing it as generic as possible so that all kind of
providers can implement it. That's why adding specific lock_row calls
might be confusing. Also, how would we manage a multiple-rows update?
There are a lot of cases where you'll want to modify several rows and
commit that once. Of course, there are transactions, but what about
providers that don't have transactions? How can we tell it to cancel the
modification we just made to a set of rows? or to commit it?

cheers




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