Re: [gnome-db] Design issues about build providers



On Mon, 2002-07-08 at 18:50, German Poo Caaman~o wrote:
> I'm working on LDAP provider, but it stopped me in a design issue
> when I was programming gda_ldap_provider_get_schema (the
> implementation of provider_class->get_schema).
> 
> According to other providers I see that depending of the 
> schema required is the GdaDataModel returned, this DataModel 
> is created as required and only the connection is kept.
> 
> At moment, I can get the tables (objectClasses), but I
> can't get *only one* table to get their columns or fields 
> (attributeType required and allowed).  
>
why?

> By the way, when
> I get all tables I know the fields of each one.  So,
> my chance is read the first time all data and keep them in
> a hash, tree or list.
> 
yes, sounds good, although you'll have to add code to listen for changes
in that data, so that you can keep the list up-to-date.

> But, I don't know what is the better moment to read all
> of them: after connect, when the schema is required or
> anything else.  Also, I don't know if this kind of
> implementarion is allowed, because if the the schema
> changes it could be necessary to re-read all schema.
> In LDAP is not a common task, specially with OpenLDAP
> where the catalog (schema) is read-only, its mean
> that isn't possible create new tables (objectClass)
> with the protocol.
> 
the best moment to read all data could be when opening the connection.
Although you'll have to make sure to not block the client app waiting
for gda_client_open_connection to return. So, if the operation takes too
long, you might better have it read the data the first time get_schema
is called.

About the changes, as I said, you have to make sure you keep the
in-memory data up-to-date with what is in the LDAP server, to avoid
problems. If it's read-only, that's ok, there's nothing more to do, but
if it's not, make sure you listen for changes in some way.

cheers



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