The SAP JDO implementation exposes a preconfigured PersistenceManagerFactory (PMF), which the applications lookup from the JNDI registry and use to get PersistenceManager instances.
The JDO implementation is deployed on the J2EE Engine as a resource adapter compliant with the J2EE Connector Architecture. The default PMF is instantiated with parameters, which are configured at deployment time.
To use the default PMF, you must:
1. Look up the PMF in the application component’s code using the following string: java:comp/env/jdo/defaultPMF.
2. Add a reference to the default PMF in the deployment descriptor of the component. For more information about adding resource references, see Configuring Resource References (for Web components) and Declaring Resource References (for enterprise beans).
The parameters for the resource reference are as follows:
Parameter Name |
Value |
Resource Reference Name |
jdo/defaultPMF |
Resource Type |
javax.resource.cci.ConnectionFactory |
Resource Authentication |
Container |
Resource Sharing Scope (selected) |
Shareable |
3. Add a hard reference to the sap.com.jdo application in the additional deployment descriptor of your application (application-j2ee-engine.xml). For more information about adding a reference, see Editing Application References.
The parameters for the reference are as follows:
Parameter Name |
Value |
Reference target |
com.sap.jdo |
Reference type |
hard |
Reference target type |
application |
Provider name |
sap.com |
The JDO specification defines a set of standard properties for the PMF. At deployment time, these properties are configured for the default PMF.
At runtime you can modify the value of only one of these properties – javax.jdo.option.ConnectionFactoryName. You can view and change its value in the Runtime tab of the Connector Container Service in the Visual Administrator. To do this, select sap.com/com.sap.jdo/SAPJDO in the Connectors → Connector 1.0 tree, and go to the ManagedConnectionFactory → Properties tab.
Properties Configurable via Visual Administrator
Property |
Description |
Default Value |
ConnectionFactoryName |
The name of the DataSource that is used by the SAP JDO implementation to provide a connection to the underlying relational database. |
jdbc/SAP/BC_JDO |
Most of the PMF properties are only configurable using the JDO API. These are:
Properties Configurable via JDO API
Property |
Description |
Default Value |
javax.jdo.option.NontransactionalRead |
When enabled, data is not locked in the database for read operations. |
true |
javax.jdo.option.NontransactionalWrite |
When enabled, it is possible to modify data outside a transaction. |
false |
javax.jdo.option.Optimistic |
When enabled, optimistic transactions are allowed. For more information about the use of this property, see Transactions in JDO. |
true |
javax.jdo.option.RestoreValues |
When enabled, at transaction rollback the values of the managed fields of a JDO instance are restored to their state as of the call to the makePersistent() method; otherwise, the changed values are saved during the rollback. |
false |
javax.jdo.option.RetainValues |
When enabled, the new values of the persistent fields are kept in the cache after the end of the transaction |
false |
javax.jdo.option.IgnoreCache |
When enabled, the queries ignore changed values in the cache. |
true |
Finally, there is one property, which you cannot modify:
Non-Configurable Properties
Property |
Description |
Default Value |
javax.jdo.option.Multithreaded |
When enabled, a managed instance may be accessed by multiple threads, and the PersistenceManager synchronizes the accesses. |
false |