Re: Alternative new libpq interface. - Mailing list pgsql-hackers

From M.Feldtmann@t-online.de (Marten Feldtmann)
Subject Re: Alternative new libpq interface.
Date
Msg-id 13BsDG-0xEwFsC@fwd02.sul.t-online.com
Whole thread Raw
In response to Re: Alternative new libpq interface.  (Chris Bitmead <chrisb@nimrod.itg.telstra.com.au>)
List pgsql-hackers
On Tue, 11 Jul 2000 11:05:04 +1000, Chris Bitmead wrote:

>
>Each programming language has a specified ODMG interface. Database
>objects are mapped 1:1 with language objects. Every time you read
>a database object a language object is created to represent it.
>
Ok, this is defined as the language bindungs mentioned in this 
book.

>Now if you read the same database object in different places in your
>code. Maybe the same object is "navigated" to via different paths,
>you don't want two objects created in memory to represent that object.
>If that happened you could have a confusing integrity situation.
>
>So with an ODMG interface it keeps track of what database objects
>are in memory at any one time - think of it as a cache, and makes
>sure that if you request the same object again, it doesn't construct
>a new one but returns the existing one.
>
Hmmm, what you want is not that easy. It means, that the object
data is stored several times on the client:
- you MUST hold an independent cache for each open connection   to the database.- you MUST copy the values from the
cacheto the language  dependent representation.
 
And you still do not get the result you want to have: the
integrity problem. What happens, if the cache is not big
enough. How are cached objects thrown away ? Garbage Collector
in the cache system ??
And another point: this has nothing to do with an ODMG interface.
It's just a nice performance hint for database access, but
ODMG has nothing to do with it.
Normally the identity is assured by the language binding - either
by the database (as you would like it) or by the binding of a
particular language to this database.
To get an ODMG language binding you may use the libpq. You may
put a cache system on top of this libpq and you have the thing 
you perhaps want to have. That's all you really need. 
What indeed would be a big win, it the chance to retrieve different 
result sets with one query !

Marten


----

Marten Feldtmann, Germany



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: postgres 7.2 features.
Next
From: Chris Bitmead
Date:
Subject: Re: postgres 7.2 features.