Use eclipselink.oracle.proxy-type to specify the proxy type to be passed to the OracleConnection.openProxySession method.
Values
Table 5-72 describes this persistence property's values.
Table 5-72 Valid Values for oracle.proxy-type
| Value | Description |
|---|---|
|
|
|
|
|
|
|
|
Usage
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.
Examples
Example 5-71 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”);
See Also
For more information, see:
Oracle Proxy Authentication Example
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Oracle/Proxy
Auditing example
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Auditing