Thread-safe PREPARE in ecpg - Mailing list pgsql-patches

From ITAGAKI Takahiro
Subject Thread-safe PREPARE in ecpg
Date
Msg-id 20070925150815.F3F8.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
Responses Re: Thread-safe PREPARE in ecpg  (Michael Meskes <meskes@postgresql.org>)
List pgsql-patches
Here is a WIP patch to make prepared statements thread-safe in ecpg.
The variable prep_stmts was global but not protected by any locks.
I divided it into per-connection field so that we can access prepared
statements separately in each thread.

I needed to change the following exported functions, but it will
introduce an incompatibility issue. It might be ok for CVS HEAD,
but I'd like to port the fix to back versions. Do you have any
thoughts on how we can accomplish this better?

From:
  - bool ECPGdeallocate(int, int, const char *name);
  - bool ECPGdeallocate_all(int, int);
  - char *ECPGprepared_statement(const char *name, int);
To:
  - bool ECPGdeallocate(int, int, const char *connection_name, const char *name);
  - bool ECPGdeallocate_all(int, int, const char *connection_name);
  - char *ECPGprepared_statement(const char *connection_name, const char *name, int);
(connection_name argument is added.)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment

pgsql-patches by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: [HACKERS] 'Waiting on lock'
Next
From: Simon Riggs
Date:
Subject: Re: [HACKERS] 'Waiting on lock'