[gnome-db]Re: [Glade-devel] handling gda connections



On 31 Mar 2001 14:45:25 +0200, Daniel Wagner wrote:
> On Thu, 29 Mar 2001, Rodrigo Moya wrote:
> 
> > On 29 Mar 2001 13:08:36 +0200, Daniel Wagner wrote:
> > > Hi
> > > 
> > > Sorry for bothering you again, but I have some small problems with gnome-db. As Damon
> > > proposed I have added a property which allows you to edit 'Data Source' and
> > > select one. So far so good.
> > > But how should I handle each connection. I see two possibilities:
> > > 
> > > 1. Each gnome-db widget controls its own gda connections. I don't see
> > > actually how this should work, but I guess its feasible. Any ideas?
> > > 
> > 
> > well, it should work, but I don' think it's the best way, since this
> > will duplicate data in memory, and
> > make very difficult the synchronization of all the widgets.
> > 
> > > 2. The connection are global visible. Therefore a connection can be
> > > shared and furthermore it has to be opened/closed only once. 
> > > 
> > 
> > you should be using Gda_ConnectionPool's, which do exactly this. The
> > Gda_ConnectionPool object is
> > a bit incomplete, so please comment on what you think it's missing, and
> > I'll add it.
> > I think that's the best way, so that all widgets share the same
> > connections, and get proper notifications all of them at the same time
> > (for example, if you close the database, all widgets connected to that
> > database could get a notification so that they refresh themselves).
> 
> But how could I connect to a signal from a Gda_Connection object? This
> kind of code is not possible then, right?:
> 
> cnc = gda_connection_new (gda_corba_get_orb ());
> gtk_signal_connect (GTK_OBJECT (cnc), "open",
>                     GTK_SIGNAL_FUNC (connection_initiated_cb),
>                     (gpointer) instance_data);
> /* use gnome_db_login to open connnection */
> 
> Is there another way to do such a thing?
> 

no there isn't, you're right. The problem I see is that the GnomeDbLogin
should also support
being created from a Gda_ConnectionPool, so that you can connect to the
"open" signal in the
Gda_ConnectionPool class, and thus do exactly the same you're doing here
but with the
Gda_ConnectionPool instead of the Gda_connection class.

Let me have a look at this

cheers

-- 
Rodrigo Moya <rodrigo gnome-db org> <rodrigo ximian com>
http://www.gnome-db.org/





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