Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SZH-0000Ld-UR for psycopg@arkaria.postgresql.org; Fri, 05 Oct 2018 16:03:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g8SZG-0006xC-3f for psycopg@arkaria.postgresql.org; Fri, 05 Oct 2018 16:03:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SZF-0006x4-Pl for psycopg@lists.postgresql.org; Fri, 05 Oct 2018 16:03:05 +0000 Received: from sonic301-22.consmr.mail.ir2.yahoo.com ([77.238.176.99]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g8SZC-0000SL-4i for psycopg@lists.postgresql.org; Fri, 05 Oct 2018 16:03:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1538755379; bh=kZlgSxkaF4OwApu6ZrG1jTduih9KHXTnCAgDSjGACU8=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=YgM7KyFqKaqnnm310Z2g4tqPTguZRV26ruPMrbE+7KK9INREz5/HUGEB4QPILLvr3WlxtlQ5q4PynpIJel/UukgGrHHTC0HdHjEob0zuXDR9RdhBX6QdnsQ5ewabnESIMzf/prdSfX5Ov0uRgpTBGjVW4g3kQ1pq+lbXMrEMjvqS20INbGTOSlK3Tc//O5VMBn330/2znSw4iBxIGWUkGDTAE+GvdQwyiE/9UCLPfwr+1wziEIWaHV32iF2313k8zT+YvQWk7UDgYtbXIhO71PUyORfzpFM2115E8p+/aNxZLPWq44HvgVKbAc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xaUxwM- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Fri, 5 Oct 2018 16:02:59 +0000 Date: Fri, 5 Oct 2018 16:02:58 +0000 (UTC) From: Christian Ferrari Reply-To: Christian Ferrari To: psycopg@lists.postgresql.org Message-ID: <602182297.6960405.1538755378178@mail.yahoo.com> In-Reply-To: <1005537726.6324310.1538685211791@mail.yahoo.com> References: <1005537726.6324310.1538685211791@mail.yahoo.com> Subject: Re: Integration of Psycopg with XTA MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6960404_91364568.1538755378175" X-Mailer: WebService/1.1.12512 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0 Content-Length: 8473 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_6960404_91364568.1538755378175 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In a previous mail I stated something like "the name of the method doesn't = matter"...... after better thinking I realized a decent name might be bette= r than other ones...Let me say: get_native_conn()get_native_connection() might be better than "get_something_pgconn" because the same type of method= could be useful for other databases in the future...More or less all the d= atabases use a "native connection", only PostgreSQL uses "PGconn connection= ". Have a good w.e.Ch.F. ------------------------------------------------------------- Good design can't stop bad implementation =20 Il gioved=C3=AC 4 ottobre 2018, 12:36:53 CEST, Federico Di Gregorio ha scritto: =20 =20 On 10/04/2018 12:30 PM, Daniele Varrazzo wrote: > On Thu, Oct 4, 2018 at 11:24 AM Federico Di Gregorio=C2=A0 = wrote: >> On 10/04/2018 12:13 PM, Daniele Varrazzo wrote: >>> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio=20 wrote: >>>> @Daniele, I see that a capsule has an implicit state, "invalid" if th= e >>>> pointer inside it is null. Does it makes sense to reuse the same=20 capsule >>>> and keep a reference to it to be able to invalidate it when the >>>> connection is closed? >>> I can take a look at it but I suspect it's a lot of work for a feature >>> very rarely used. >> Nah, I can do it. I was just asking for your opinion. :D > I don't know much about the capsule object, its life cycle etc. Yes, > not a huge deal saving it in the connection state and returning always > the same. I just wonder if it's worth the effort. I suppose it helps to debug the situation where the capsule is used=20 after the connection has been closed. Instead of a BOOM you get a nice=20 exception (if the consumer checks for it, obviously). I'll work on this in my repo and if everything works we can integrate it=20 for 2.8. federico --=20 Federico Di Gregorio=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 federico.digregorio@dndg.it DNDG srl=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://dndg.it =C2=A0 Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare =C2=A0 =C2=A0 i `domani'.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 -- Haruki Murakami =20 ------=_Part_6960404_91364568.1538755378175 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In a previous = mail I stated something like "the name of the method doesn't matter"...
... after better thinking I realized a decent name might be better t= han other ones...
Let me say:

get_native= _conn()
get_native_connection()

might be= better than "get_something_pgconn" because the same type of method = could be useful for other databases in the future...
More or less= all the databases use a "native connection", only PostgreSQL uses "PGconn = connection".

Have a good w.e.
Ch.F.<= br>

---------------= ----------------------------------------------
Good design can't stop bad implementation


=20
Il gioved=C3=AC 4 ottobre 2018, 12:36:53 CEST, Federico= Di Gregorio <fog@dndg.it> ha scritto:


On 10/04/2018 12:30 PM, Daniele Varra= zzo wrote:
> On Thu, Oct 4, 20= 18 at 11:24 AM Federico Di Gregorio<fog@dndg.it>  wrot= e:
>> On 10/04/2018 12:13 P= M, Daniele Varrazzo wrote:
>&g= t;> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<fog@dn= dg.it>
wrote:
>>>> @Daniele, I see that a capsu= le has an implicit state, "invalid" if the
>>>> pointer inside it is null. Does it makes sense t= o reuse the same
capsule
>>>> and keep a reference to = it to be able to invalidate it when the
>>>> connection is closed?
>>> I can take a look at it but I suspect it's a lot = of work for a feature
>>>= ; very rarely used.
>> Nah,= I can do it. I was just asking for your opinion. :D
> I don't know much about the capsule object, its li= fe cycle etc. Yes,
> not a hug= e deal saving it in the connection state and returning always
> the same. I just wonder if it's worth the= effort.

=
I suppose it helps to debug the situation where the capsul= e is used
after the connection ha= s been closed. Instead of a BOOM you get a nice
exception (if the consumer checks for it, obviously).

I'll work on this in my repo and if everything works we can integrate it =
for 2.8.
=

federico

--
Federico Di Gregorio  &n= bsp;                     = federico.digregorio@dndg.it
DNDG srl            &nbs= p;                     &n= bsp;               http://dndg.it<= br clear=3D"none">
  Gli avvoltoi cinesi si nut= rono di arte, ma possono anche mangiare
    i `domani'.            &n= bsp;                     =       -- Haruki Murakami

------=_Part_6960404_91364568.1538755378175--