Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Obtaining Instance of Connection from EM
Obtaining Instance of Connection from EM [message #538073] Fri, 04 June 2010 20:28 Go to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
Member
Is there a way to obtaing the instance of java.sql.Connection being used by an instance of EntityManager?

Thanks, Mauro.
Re: Obtaining Instance of Connection from EM [message #538474 is a reply to message #538073] Mon, 07 June 2010 16:58 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

In JPA 2.0 you can use,

entityManager.unwrap(java.sql.Connection.class)

Previously you could access the connection from the DatabaseAccessor of the EntityManager's Session.


James : Wiki : Book : Blog : Twitter
Previous Topic:Query across Variable One to One mapping
Next Topic:HistoryPolicy: INSERT Error with missing fields
Goto Forum:
  


Current Time: Sat Apr 20 06:28:18 GMT 2024

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

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

Back to the top