Known issues with Oracle
-
The Oracle JDBC driver has significant differences between different versions. It is important to use the officially supported version of the drivers (10.2.0.1.0/11.2.0.x.0), which is backward compatible with previous versions of the Oracle server. It can be downloaded from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
-
Empty string/char values are stored as NULL.
-
Oracle corp’s JDBC driver for Oracle has only limited support for batch updates. The result for OpenJPA is that batching of some statements may fail and in some cases, the exact object that failed an optimistic lock check cannot be determined. OpenJPA will throw an
OptimisticExceptionwith more failed objects than actually failed. This situation may be resolved by disabling statement batching by setting the batchLimit value to zero or by using a more recent Oracle JDBC Driver (11.2.0.1) with batch support improvements. Attempting to resolve the issue with a more current driver is recommended since disabling statement batching can result in a decrease in performance.
openjpa.jdbc.DBDictionary: oracle(batchLimit=0)
-
Oracle cannot store numbers with more than 38 digits in numeric columns.
-
Floats and doubles may lose precision when stored.
-
CLOB columns cannot be used in queries.
-
The use of LOBs with persistent attributes of a streaming data type (ex.
java.io.InputStreamorjava.io.Reader) may require the same connection to be used over the life of the transaction or entity manager. If the same connection is not used for persistent operations ajava.io.IOExceptionwith messageClosed Connectionmay result. The OpenJPA propertyopenjpa.ConnectionRetainModecan be used to control how OpenJPA uses datastore connections. See Configuring the Use of JDBC Connections for details.
openjpa.ConnectionRetainMode: always
-
Mapping persistent attributes to XML columns requires a JDBC 4 compliant driver if XML strings are longer than 4000 bytes, as counted in database. Otherwise an
ORA-01461: can bind a LONG value only for insert into a LONG columnerror may result. -
If Oracle dictionary property
MaxEmbeddedBlobSizeorMaxEmbeddedClobSizeis set to some limit (i.e. not -1) and embedded collection with BLOB/CLOB attribute is used, a"org.apache.openjpa.persistence.ArgumentException: "x.y.z.EmbedOwner.embedCollection<element:class x.y.z.EmbedValue>" is mapped as embedded, but embedded field "x.y.z.EmbedOwner.embedCollection.x.y.z.EmbedValue.blob" is not embeddable. Embedded element/key/value types are limited to simple fields and direct relations to other persistent types"error may result. To overcome this limitation, either use JDBC driver 11.2.0.x.0 (or later version) or set bothMaxEmbeddedBlobSizeandMaxEmbeddedClobSizeproperties to -1.