Re: Gnome-DB and Bonobo
Rodrigo Moya <[email protected]> Thu, 03 Jun 2004 12:03:03 +0200
| Newsgroups | gmane.comp.gnome.components |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 2004-06-03 at 11:11 +0200, Jean Bréfort wrote: > Le mer 02/06/2004 à 21:07, Mikkel Kruse Johnsen a écrit : > > Hi All > > > > Im trying to figure out what to do with database connections in my > > program and need some advise, so any suggestions is appreciated. > > > > The program consists of a BonoboWindow that activates and embed a > > BonoboControl and is the "shell", the "shell" activates a number of > > BonoboControl's called "views" and the "views" again activates different > > BonoboControl's. Some of these BonoboControl are written in C and some > > in C# (Mono). > > > > My problem is that almost all of the controls need to access a database, > > I have now just made all components create a connection to a MySQL > > database, but that is a waste to have that many connections open. I am > > now changing the database to PostgreSQL (do to license changes in > > MySQL). > > > > So I need some way of creating a connection pool that all my components > > can use whether it is C or C#. So the logical solution is to use > > Gnome-DB witch is in C and has a C# wrapper. > > > > Anyone has any other solutions or is this a good solution ? > > > > If I choose to go with gnome-db, how would I go about transferring the > > GdaClient (which I understands makes a connection pool) to my > > BonoboControls. Is there anyway to do that ? > > > > Any help is appreciated. > > > > /Mikkel > > I suppose you create all your bonobo controls with the same server. If > the GdaClient is a global variable in the server, all controls will have > access to it. > right, that seems to be the best solution. Use a GdaClient in your control factory and share it between all the controls. cheers