Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home »  » EclipseLink » Unwrap Member JDBC Connections in Composite Persistence Unit(When a Composite Persistence Unit is used, the entityManager.unwrap(Connection.class) returns null)
Unwrap Member JDBC Connections in Composite Persistence Unit [message #1744068] Thu, 22 September 2016 07:41
Piergiuseppe Spinelli is currently offline Piergiuseppe SpinelliFriend
Messages: 1
Registered: September 2016
Junior Member
When a Composite Persistence Unit is used, the entityManager.unwrap(Connection.class) returns null.

This seems to be logic since there is not a single JDBC Connection associated to the Composite Unit but one for each member unit.

However, there is a way to get the JDBC connectiona associated to a specific memebr unit?

An use case for these could be streaming data to a blob field of a JPA Entity to avoid to keep a whole big byte array in memory. The EclipseLink documentation advice to unwrap the JDBC connection end use PreparedStatement.setBynaryStream method.

Previous Topic:Turning off query Caching in Spring Data
Next Topic:EclipseLink minimum version which supports TABLE_PER_TENANT type
Goto Forum:
  


Current Time: Sun Dec 17 00:46:33 GMT 2017

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

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