Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 96E216325F4 for ; Fri, 15 Jan 2010 12:21:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55708-05 for ; Fri, 15 Jan 2010 16:21:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id C4D2A632217 for ; Fri, 15 Jan 2010 12:21:27 -0400 (AST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id A3E521E044A; Sat, 16 Jan 2010 00:21:24 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AtRcLZbKBiIK; Sat, 16 Jan 2010 00:21:23 +0800 (WST) Received: from [10.1.1.5] (203-206-118-60.dyn.iinet.net.au [203.206.118.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 07A0A1E0449; Sat, 16 Jan 2010 00:21:23 +0800 (WST) Message-ID: <4B5095F5.20508@postnewspapers.com.au> Date: Sat, 16 Jan 2010 00:21:09 +0800 From: Craig Ringer User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Steve Waldman CC: Dave Cramer , Vaibhav Patil , "pgsql-jdbc@postgresql.org" Subject: Re: COPY using Hibernate References: <170472.26453.qm@web94901.mail.in2.yahoo.com> <491f66a51001150400sf2c6b04l840af9f01c3e55bb@mail.gmail.com> <4B5066B1.6050709@postnewspapers.com.au> <82F2099D-4E4C-4073-A900-56A08DDEFD34@mchange.com> In-Reply-To: <82F2099D-4E4C-4073-A900-56A08DDEFD34@mchange.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201001/26 X-Sequence-Number: 20222 Steve Waldman wrote: > you can just check out the inner Connection with c3p0's reflective API, > if you want. the preachiness is a speedbump, but nothing prevents you > from returning RAW_CONNECTION_OBJECT. just be sure that when you're > done, the you've not left the state of the Connection modified, cuz that > can lead to subtle misbehavior. With Hibernate's Session object, sure - you can getConnection() from the session, then reflectively access the methods of the underlying PGConnection via C3P0. It's ugly but works. I was about to say that you can't get the Connection object from EntityManager if using Hibernate, when I realised you can call EntityManager.getDelegate() to get the Session, then getConnection() on that. I have no idea how I missed getDelegate() before. Sigh. Guess you *can* just use C3P0's reflective calls even if using JPA. -- Craig Ringer