Use eclipselink.oracle.proxy-type
to specify the proxy type to be passed to the OracleConnection.openProxySession
method.
Table 5-71 describes this persistence property's values.
Table 5-71 Valid Values for oracle.proxy-type
Value | Description |
---|---|
|
|
|
|
|
This property requires Oracle JDBC version 10.1.0.2 or later and eclipselink.target-database
must be configured to use Oracle9
or later.
Typically, you should set this property into EntityManager
, through a createEntityManager
method or by using proprietary setProperties
method on EntityManagerImpl
. This causes EntityManager
to use proxy connection for writing and reading inside transaction.
If proxy-type
and the corresponding proxy
property set into EntityManagerFactory
, all connections created by the factory will be proxy connections.
Example 5-69 Using eclipselink.oracle.proxy-type with EntityManager
Map emProperties = new HashMap();
emProperties.put("eclipselink.oracle.proxy-type", OracleConnection.PROXYTYPE_USER_NAME);
emProperties.put(OracleConnection.PROXY_USER_NAME, "john");
EntityManager em = emf.createEntityManager(emProperties);
With injection:
entityManager.setProperty(“eclipselink.oracle.proxy-type”, OracleConnection.PROXYTYPE_USER_NAME); entityManager.setProperty(OracleConnection.PROXY_USER_NAME, “john”);
For more information, see: