> The manual suggests:- > > OpenJPAEntityManagerFactory kemf = OpenJPAPersistence.cast(emf); > OpenJPAConfiguration conf = kemf.getConfiguration(); > > on page 190, but kemf does not have a getConfiguration method according > to Eclipse (using OpenJPA 1.0.2).
Oops; that's out-of-date. Getting the Configuration isn't part of the published APIs. In addition, that documentation shows how to find a separate connection, not the one currently in use by the EM. For what you've described, you should use OpenJPAEntityManager.getConnection() and cast the returned object to a Connection. The returned connection is a wrapper; you may need to dig through it to get to the underlying Connection if you need to use Postgres-specific methods. Don't forget to close() the connection when you're done with it -- OpenJPA does reference counting on the connections it doles out in order to properly handle the ConnectionRetainMode setting. Out of curiosity, what types of large object stuff do you need to do? -Patrick On Mon, Mar 31, 2008 at 7:15 AM, David Goodenough <[EMAIL PROTECTED]> wrote: > I need to get to the real JDBC Connection object so that I can do some > processing using Postgresql extensions (in particular the LargeObject > support). I do not expect OpenJPA to understand what I am doing, but > I need to access the Connection object and I need what I do to be > in the same transaction as that used by OpenJPA (so also it needs to > be the same transaction). > > The manual suggests:- > > OpenJPAEntityManagerFactory kemf = OpenJPAPersistence.cast(emf); > OpenJPAConfiguration conf = kemf.getConfiguration(); > > on page 190, but kemf does not have a getConfiguration method according > to Eclipse (using OpenJPA 1.0.2). > > The OpenJPAConfiguration javadoc is not much use either in that it does > tell me where to get it from. > > Any ideas? > > David > -- Patrick Linskey 202 669 5907
