JpaDialect implementation for Eclipse
Persistence Services (EclipseLink). Developed and tested against EclipseLink 2.7;
backwards-compatible with EclipseLink 2.5 and 2.6 at runtime.
By default, this class acquires an early EclipseLink transaction with an early
JDBC Connection for non-read-only transactions. This allows for mixing JDBC and
JPA/EclipseLink operations in the same transaction, with cross visibility of
their impact. If this is not needed, set the "lazyDatabaseTransaction" flag to
true or consistently declare all affected transactions as read-only.
As of Spring 4.1.2, this will reliably avoid early JDBC Connection retrieval
and therefore keep EclipseLink in shared cache mode.
public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction)
Set whether to lazily start a database resource transaction within a
Spring-managed EclipseLink transaction.
By default, read-only transactions are started lazily but regular
non-read-only transactions are started early. This allows for reusing the
same JDBC Connection throughout an entire EclipseLink transaction, for
enforced isolation and consistent visibility with JDBC access code working
on the same DataSource.
Switch this flag to "true" to enforce a lazy database transaction begin
even for non-read-only transactions, allowing access to EclipseLink's
shared cache and following EclipseLink's connection mode configuration,
assuming that isolation and visibility at the JDBC level are less important.
This implementation invokes the standard JPA Transaction.begin
method. Throws an InvalidIsolationLevelException if a non-default isolation
level is set.
This implementation does not return any transaction data Object, since there
is no state to be kept for a standard JPA transaction. Hence, subclasses do not
have to care about the return value (null) of this implementation
and are free to return their own transaction data Object.