Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » JPA build entity manager with a specific JDBC connection instance
JPA build entity manager with a specific JDBC connection instance [message #532807] Tue, 11 May 2010 05:42 Go to next message
Eclipse UserFriend
I want to manage the database connection outside entity manager context so that I can use it for different entity managers. The question is how can I build the entity manager factory or entity manager with my own connection instead of providing it with properties in persistence.xml?
Re: JPA build entity manager with a specific JDBC connection instance [message #533353 is a reply to message #532807] Thu, 13 May 2010 09:48 Go to previous message
Eclipse UserFriend
Using the same JDBC connection for multiple EntityManager does not sound like a good idea. What are you trying to accomplish?

If you use JTA, then all JDBC access in the same JTA transaction will use the same JDBC connection.

You can set the connection in an EntityManager but accessing its ClientSession and setting the writeConnection's connection.

You could also try customizing your own ConnectionPool in your ServerSession.


Previous Topic:Is it possible to run a @TableGenerator in a separate transaction?
Next Topic:MappedSuperclass doesn't work with dynamic weaving
Goto Forum:
  


Current Time: Tue Jul 22 19:00:05 EDT 2025

Powered by FUDForum. Page generated in 0.03297 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top