Defines the properties necessary to configure runtime properties and
connect to a data source. There is a 1-1 relation between a configuration
and a
BrokerFactory .
All setter methods that take primitive parameters also have wrapper
setter with the appropriate primitive wrapper. This is so the interface
can be in accordance with the J2EE Connector Architecture.
author: Marc Prud'hommeaux author: Abe White See Also:Configuration
getDataCacheManagerInstance() The data cache manager manages this configuration's cache instances.
The cache manager is created if it has not been set.
getRetainState() Whether to retain state after a transaction by default.
public boolean
getRetryClassRegistration() Whether to warn and defer registration instead of throwing an
exception when a registered persistent class cannot be processed.
setIgnoreChanges(boolean ignoreChanges) Whether changes in the current transaction are taken into account when
executing queries and iterating extents.
setRetryClassRegistration(boolean warn) Whether to warn and defer registration instead of throwing an
exception when a registered persistent class cannot be processed.
setSpecification(String spec) Set the specification that this configuration should use for the
various properties that need to have different defaults for different
spec environments.
Specifies the behavior of the broker with respect to data store
connections. Possible values are:
always: Each broker obtains a single connection and
uses it until the broker is closed.
transaction: A connection is obtained when each
transaction begins (optimistic or datastore), and is released
when the transaction completes.
on-demand: Connections are obtained only when needed.
This is the default mode. It is equivalent to the previous option
when datastore transactions are used. For optimistic transactions,
though, it means that a connection will be retained only for
the duration of the data store commit process.
since: 0.2.5
getConnectionRetainModeConstant
public int getConnectionRetainModeConstant()(Code)
Return the connection retain mode as one of the following symbolic
constants:
The data cache manager manages this configuration's cache instances.
The cache manager is created if it has not been set. Once the cache
manager has been set/created, all changes to caching configuration
must proceed through the cache manager.
since: 0.3.0
Whether to warn and defer registration instead of throwing an
exception when a registered persistent class cannot be processed.
Should only be set to true in complex classloader topologies.
Defaults to false.
since: 0.3.2.3
Specifies how OpenJPA handles unenhanced types. Possible values are:
supported: Runtime optimization of persistent types
is available. This is the default
unsupported: Runtime optimization of persistent types
is not available. An exception will be thrown if the system loads with
persistent types that are not enhanced.
warn: Runtime optimization of persistent types is
not available, but no exception will be thrown initially. A warning will
be logged instead. It is likely that the system will fail at a later
point. This might be suitable for environments with complex classloader
configurations.
since: 1.0.0
getRuntimeUnenhancedClassesConstant
public int getRuntimeUnenhancedClassesConstant()(Code)
Return the runtime class optimization setting as one of the
following symbolic constants:
public void setCompatibility(String compatibility)(Code)
Backwards compatibility options.
setConnection2DriverName
public void setConnection2DriverName(String driverName)(Code)
Class name of the non-XA connection driver.
setConnection2Password
public void setConnection2Password(String connectionPassword)(Code)
The password for the non-XA data store connection.
setConnection2Properties
public void setConnection2Properties(String props)(Code)
These properties provide any additional information needed to
establish non-XA connections.
since: 0.3.0
setConnection2URL
public void setConnection2URL(String connectionURL)(Code)
The URL for the non-XA data store connection.
setConnection2UserName
public void setConnection2UserName(String connectionUserName)(Code)
The user name for the non-XA data store connection.
setConnectionDriverName
public void setConnectionDriverName(String driverName)(Code)
Class name of the connection driver.
setConnectionFactory
public void setConnectionFactory(Object factory)(Code)
The connection factory.
setConnectionFactory2
public void setConnectionFactory2(Object factory)(Code)
The non-XA connection factory.
setConnectionFactory2Name
public void setConnectionFactory2Name(String cf2Name)(Code)
The name for the second data store connection factory.
setConnectionFactory2Properties
public void setConnectionFactory2Properties(String props)(Code)
Configuration properties for the non-XA connection factory.
since: 0.2.5
setConnectionFactoryMode
public void setConnectionFactoryMode(String mode)(Code)
The mode of the connection factory in use. Available options are:
local: OpenJPA controls the connections.
managed: Connections are automatically enlisted in
the current global transaction by an application server.
Defaults to local.
setConnectionFactoryModeManaged
public void setConnectionFactoryModeManaged(boolean managed)(Code)
Whether connections are automatically enlisted in global transactions.
setConnectionFactoryName
public void setConnectionFactoryName(String cfName)(Code)
The name for the data store connection factory.
setConnectionFactoryProperties
public void setConnectionFactoryProperties(String props)(Code)
Configuration properties for the connection factory.
setConnectionPassword
public void setConnectionPassword(String connectionPassword)(Code)
The password for the data store connection.
setConnectionProperties
public void setConnectionProperties(String props)(Code)
These properties provide any additional information needed to
establish connections.
setConnectionRetainMode
public void setConnectionRetainMode(String mode)(Code)
Specifies the behavior of the broker with respect to data store
connections. Possible values are:
always: Each broker obtains a single connection and
uses it until the broker is closed.
transaction: A connection is obtained when each
transaction begins (optimistic or datastore), and is released
when the transaction completes.
on-demand: Connections are obtained only when needed.
This is the default mode. It is equivalent to the previous option
when datastore transactions are used. For optimistic transactions,
though, it means that a connection will be retained only for
the duration of the data store commit process.
since: 0.2.5
setConnectionRetainMode
public void setConnectionRetainMode(int mode)(Code)
Set the connection retain mode as one of the following symbolic
constants:
public void setRetryClassRegistration(boolean warn)(Code)
Whether to warn and defer registration instead of throwing an
exception when a registered persistent class cannot be processed.
Should only be set to true in complex classloader topologies.
Defaults to false.
since: 0.3.2.3
setRetryClassRegistration
public void setRetryClassRegistration(Boolean warn)(Code)
public boolean setSpecification(String spec)(Code)
Set the specification that this configuration should use for the
various properties that need to have different defaults for different
spec environments. This should be invoked before any configuration
options are set, as it will mutate various values.
You can only assign the specification once, though it is not fatal
to attempt to do so multiple times. Attempts to set to null will
be ignored.