This chapter describes issues associated with Oracle TopLink. It includes the following topics:
This section describes general issue and workarounds. It includes the following topic:
Section 8.1.5, "Managed Servers on Sybase with JCA Oracle Database Service"
Section 8.1.6, "Logging Configuration with EclipseLink Using Container Managed JPA"
This section contains information on the following issues:
Section 8.1.1.1, "Incorrect outer join SQL on SQLServer2005"
Section 8.1.1.2, "UnitOfWork.release() not Supported with External Transaction Control"
Section 8.1.1.3, "Returning Policy for UPDATE with Optimistic Locking"
Section 8.1.1.4, "JDBC Drivers returning Timestamps as Strings"
Section 8.1.1.6, "Unit of Work does not add Deleted Objects to Change Set"
TopLink generates incorrect outer join for SQL Server v2005. The outer join syntax generated is correct for earlier versions of this database. To work around this limitation, reconfigure the database compatibility (refer to the SQLServer documentation for details). Alternatively, you can use a custom TopLink database platform.
A unit of work synchronized with a Java Transaction API (JTA) will throw an exception if it is released. If the current transaction requires its changes to not be persisted, the JTA transaction must be rolled back.
When in a container-demarcated transaction, call setRollbackOnly()
on the EJB/session context:
@Stateless public class MySessionBean { @Resource SessionContext sc; public void someMethod() { ... sc.setRollbackOnly(); } }
When in a bean-demarcated transaction then you call rollback()
on the UserTransaction obtained from the EJB/session context:
@Stateless @TransactionManagement(TransactionManagementType.BEAN) public class MySessionBean implements SomeInterface { @Resource SessionContext sc; public void someMethod() { sc.getUserTransaction().begin(); ... sc.getUserTransaction().rollback(); } }
The returning policy, which allows values modified during INSERT
and UPDATE
to be returned and populated in cached objects, does not work in conjunction with numeric version optimistic locking for UPDATE
. The value returned for all UPDATE
operations is 1 and does not provide meaningful locking protection.
Do not use a returning policy for UPDATE
in conjunction with numeric optimistic locking.
The use of returning policy for INSERT
when using optimistic locking works correctly.
TopLink assumes that date and time information returned from the server will use Timestamp
. If the JDBC driver returns a String
for the current date, TopLink will throw an exception. This is the case when using a DB2 JDBC driver.
To work around this issue, consider using a driver that returns Timestamp
(such as COM.ibm.db2.jdbc.app.DB2Driver
) or change the policy to use local time instead of server time.
Another option is to use a query re-director on the ValueReadQuery
used by the platform:
ValueReadQuery vrq = new ValueReadQuery( "SELECT to_char(sysdate, 'YYYY-MM-DD HH:MM:SS.SSSSS') FROM DUAL" ); vrq.setRedirector(new TSQueryRedirector()); ... class TSQueryRedirector implements QueryRedirector { public Object invokeQuery(DatabaseQuery query, Record arguments, Session session) { String value = (String)session.executeQuery(query); return ConversionManager.getDefaultManager().convertObject( value, java.sql.Timestamp.class ); } }
Proxy authentication does not work with OC4J managed data sources. Instead of using the data source provided by the application server, you must create a data source yourself.
Refer to the "Configuring Oracle Database Proxy Authentication" in the Oracle Fusion Middleware Developer's Guide for Oracle TopLink for more information.
For example, replace this code:
login.setConnector( new OracleJDBC10_1_0_2ProxyConnector( ((JNDIConnectorlogin.getConnector()).getName() ) );
with the following:
oracle.jdbc.pool.OracleDataSource ds = new oracle.jdbc.pool.OracleDataSource(); ds.setUser("MyMainUser"); ds.setPassword("MyPassword"); ds.setUrl("jdbc:oracle:thin:@MyServer:1521:MyDb"); login.setConnector(new OracleJDBC10_1_0_2ProxyConnector(ds));
When accessing the change set of a Unit of Work to determine what has changed, objects that are pending deletion (such as uow.deleteObject( )
and uow.deleteAllObjects( )
) will not be returned from the result set.
The objects pending deletion are only available through the Unit of Work getDeletedObjects
call.
This section contains information on the following issues:
Due to an issue with Sun JDK 1.6, if NullPointExecption error dialog is generated when saving a file, the error dialog window is not in focus.
Due to an issue with certain configurations and versions of Windows operating systems, users that launch the TopLink Workbench with the workbench.cmd
file may receive a dialog that states: Could not find the main class. This occurs because the classpath specified contains a directory path which has periods in it. The workaround is to rename the offending directory or change the classpath to use directory paths which do not contain periods.
This section contains information on the following issue:
To fully support Oracle Spatial and Oracle XDB mapping capabilities (in both standalone Oracle WebLogic Server and the Oracle JDeveloper integrated WebLogic Server), you must use the toplink-spatial-template.jar
and toplink-xdb-template.jar
to extend the WebLogic Server domain to support Oracle Spatial and XDB, respectively.
To extend your WebLogic Server domain:
Download the toplink-spatial-template.jar
(to support Oracle Spatial) and toplink-xdb-template.jar
(to support Oracle XDB) files from:
Use Table 8-1, "To Support Oracle Spatial" or Table 8-2, "To Support Oracle XDB"
to determine which files to copy.
Table 8-1 To Support Oracle Spatial
Copy this file | From...Foot 1 ![]() |
To...Foot 2 ![]() |
---|---|---|
sdoapi.jar |
|
|
Footnote 1 These are the default locations. Your actual location may vary depending on your specific environment, installed options, and version.
Footnote 2 When using Oracle JDeveloper integrated WebLogic Server, the <WEBLOGIC_HOME>
is located within the <JDEVELOPER_HOME>
directory.
Table 8-2 To Support Oracle XDB
Copy this file | From...Foot 1 ![]() |
To...Foot 2 ![]() |
---|---|---|
xdb.jar |
|
|
xml.jar |
|
|
xmlparserv2.jar |
|
|
Footnote 1 These are the default locations. Your actual location may vary depending on your specific environment, installed options, and version.
Footnote 2 When using Oracle JDeveloper integrated WebLogic Server, the <WEBLOGIC_HOME>
is located within the <JDEVELOPER_HOME>
directory.
Note:
Although the actual JAR file may be named differently in your From directory, the file must be named as shown, when copied to the To directory.Launch the Config Wizard (<WEBLOGIC_HOME>
/common/bin/config.sh
(or .bat
).
Select Extend an existing WebLogic domain.
Browse and select your WebLogic Server domain.
When using JDeveloper with integrated WebLogic Server, the typical WebLogic Server domain location may be similar to:
In Windows environments: %APPDATA%\JDeveloper\systemXX.XX.XX.XX\DefaultDomain
where XX.XX.XX.XX
is the unique number of the product build.
For Windows platforms, you must enable the Show hidden files and folders folder option.
In non-Windows environments, the default location is under the current user's default home directory: <$Home>
/DefaultDomain
Refer to the Oracle JDeveloper documentation for details.
Select Extend my domain using an existing extension template.
Browse and select the required template JAR (toplink-spatial-template.jar for Oracle Spatial, toplink-xdb-template.jar for Oracle XDB).
Complete the remaining pages of the wizard.
By default, EclipseLink interprets zero as null for primitive types that cannot be null (such as int
and long
) causing zero to be an invalid value for primary keys. You can modify this setting by using the allow-zero-id
property in the persistence.xml
file. Valid values are:
true – EclipseLink interprets zero values as zero. This permits primary keys to use a value of zero.
false (default) – EclipseLink interprets zero as null.
Refer the EclipseLink User's Guide at http://wiki.eclipse.org/EclipseLink/UserGuide
for more information.
When using a JCA service with the Oracle Database adapter in a cluster to perform database operations on a Sybase database, the managed nodes in the cluster process the messages and may attempt to perform duplicate operations.
Because supported versions of Sybase do not support Oracle TopLink record locking, Sybase allows the duplicate operation attempts.
By default, EclipseLink users in container managed JPA will use the Oracle WebLogic Server logging options to report all log messages generated by EclipseLink. Refer to "Configuring WebLogic Logging Services" in Oracle® Fusion Middleware Configuring Log Files and Filtering Log Messages for Oracle WebLogic Server.
To use the EclipseLink native logging configuration, add the following property to your persistence.xml
file:
<property name="eclipselink.logging.logger" value="DefaultLogger"/>
TopLink DBWS deployment may fail in JRockit VM environment. When generating a WAR file for deployment, the TopLink Database Web Services (DBWS) design-time utility uses a version of ASM for code generation which is not compatible with the version of JRockit that is bundled with Oracle WebLogic Server (WLS) 10.3.3. This results in a deployment failure with the SOAP message exception Illegal target of jump or branch.
Note:
This issue does not occur when running the application server in a Sun JVM environment.To generate a DBWS deployment WAR file that will successfully deploy in a JRockit JVM environment, use this procedure:
Note:
You can complete this procedure using an IDE, such as Oracle JDeveloper.Create a new project. Add the following libraries to the classpath:
Java EE
Oracle TopLink
Oracle JWSDL
Oracle SOAP
JAX-WS Web services
JDBC Library
utils/dbws/eclipselink-dbwsutils.jar
Import the dbws-bulider.xml
file and add it to the project classpath.
Create a new file named META-INF/services/org.eclipse.persistence.tools.dbws.DBWSPackager
in the project's src
directory. The file should contain the following, single line:
org.eclipse.persistence.tools.dbws.JDevPackager
Add this newly created file to the project classpath.
Use the DBWSBuilder
utility to generate the web service artifacts in the specified directory:
Main class: org.eclipse.persistence.tools.dbws.DBWSBuilder
Arguments: -builderFile dbws-builder.xml -stageDir . -packageAs jdev
Rebuild the project. This will generate a DBWSProvider.class
file.
Use the web service artifacts to generate a WAR deployment profile. The .war
file should contain the following:
WEB-INF/web.xml
WEB-INF/weblogic.xml
WEB-INF/classes/_dbws/DBWSProvider.class
WEB-INF/classes/META-INF/eclipselink-dbws.xml
WEB-INF/classes/META-INF/eclipselink-dbws-or.xml
WEB-INF/classes/META-INF/eclipselink-dbws-ox.xml
WEB-INF/classes/META-INF/eclipselink-dbws-sessions.xml
WEB-INF/wsdl/eclipselink-dbws.wsdl
WEB-INF/wsdl/eclipselink-dbws-schema.xsd
You can now deploy the WAR file to your application server