[Top][All Lists]

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

Re: [Gnumed-devel] pooling connections

From: Ian Haywood
Subject: Re: [Gnumed-devel] pooling connections
Date: Sun, 1 Sep 2002 04:22:21 -0400
User-agent: Mutt/1.3.28i

On Mon, Sep 02, 2002 at 03:56:56AM +1000, Horst Herb wrote:
> Problem: 
> database "commits" via client libraries are done *per connection* and not per 
> cursor, unless server side cursors are used explicitly in the queries.
> Shall we rely on the developers to diligently use server side cursors for 
> write access, or shall we return a separate database connection for each 
> service request (a la psycopg)?

I suggest an abstracted API for the database, so there is no reliance on
developer 'diligience'

So to 'read' from a service:

def get_query (service, query):

Creates a connection if needed and sends the 'select' statement.

def get_query_async (service, query, callback)

callback should be called for each database row as it comes through.

To 'write':

def send_update (service, commands)

where commands is a list of SQL statements, performed as a SQL

Attachment: pgpShPtnfegZ2.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]