Not at this time.

Passing one in to the EMF would be dangerous - unless you could guarantee
that only one EM would be created. Generally you wouldn't want multiple EMs
using the same connection - it'd be very easy to shoot yourself in the foot.


The same sort of issue would exist if you passed the connection to the
EntityManager. The JPA provider would no longer be the 'sole' user of the
connection and it becomes very easy to make a mistake.

Providing a connection at EM creation could probably be done - provided the
caller understands the risks. Changing the connection an an already created
EntityManager makes me very nervous.

Is there a compelling reason why you can't just use the datasource?

-mike

On Mon, Aug 16, 2010 at 1:29 AM, hyndavi [via OpenJPA] <
[email protected]<ml-node%[email protected]>
> wrote:

> Thanks for the response. Is there any way to pass java.sql.Connection
> object to EntityManagerFactory or EntityManager?
>
> ------------------------------
>  View message @
> http://openjpa.208410.n2.nabble.com/Integrating-existing-customized-Datasource-and-Connection-objects-in-JPA-tp5411498p5426853.html
> To unsubscribe from Re: Integrating existing customized Datasource and
> Connection objects in JPA, click 
> here<http://openjpa.208410.n2.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=5413438&code=bWljaGFlbC5kLmRpY2tAZ21haWwuY29tfDU0MTM0Mzh8LTEzNTYzMTcwNDM=>.
>
>
>

-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/Integrating-existing-customized-Datasource-and-Connection-objects-in-JPA-tp5411498p5430296.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to