Re: COPY using Hibernate

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: COPY using Hibernate
Дата
Msg-id 4B5095F5.20508@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: COPY using Hibernate  (Steve Waldman <swaldman@mchange.com>)
Список pgsql-jdbc
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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Vaibhav Patil
Дата:
Сообщение: Re: COPY using Hibernate
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: COPY using Hibernate