Chapter 13. Enterprise Edition

13.1. Integrating with the Transaction Manager
13.2. XA Transactions
13.2.1. Requirements for Using Kodo with XA Transactions
13.2.2. Configuring Kodo to Utilize XA Transactions
13.3. JDOQL Subqueries
13.3.1. Subquery Parameters, Variables, and Imports
13.4. Direct SQL Execution
13.5. MethodQL
13.6. Remote PersistenceManagers
13.7. Custom Class Mappings
13.8. Non-relational Database Access

The features we've discussed thus far are all included in the Kodo JDO Standard Edition. This chapter presents features unique to the Kodo JDO Enterprise Edition. The Enterprise Edition primarily differs from the Standard Edition in its ability to integrate with application servers' global transactions and its advanced custom query capabilities. The Enterprise Edition also includes all the components of the Performance Pack, which we describe in the next chapter.

13.1. Integrating with the Transaction Manager

Kodo JDO persistence managers have the ability to automatically synchronize their transactions with an external transaction manager. Whether or not persistence managers from a given persistence manager factory exhibit this behavior by default depends on the factory's kodo.TransactionMode configuration property. The property can take the following values:

  • local: Perform transaction operations locally.

  • managed: Integrate with the application server's managed global transactions.

You can override the global transaction mode setting when you obtain a persistence manager by using the KodoPersistenceManagerFactory's getPersistenceManager(boolean managed, int connRetainMode) method.

In order to use global transactions, Kodo JDO must be able to access the application server's javax.transaction.TransactionManager . Kodo JDO can automatically discover the transaction manager for most major application servers. Occasionally, however, you might have to point Kodo JDO to the transaction manager for an unrecognized or non-standard application server setup. This is accomplished through the kodo.ManagedRuntime configuration property. This property describes a implementation to use for transaction manager discovery. You can specify your own implementation, or use one of the built-ins:

  • auto: This is the default. It is an alias for the class. This managed runtime is able to automatically integrate with several common application servers.

  • invocation: An alias for the class. You can configure this runtime to invoke any static method in order to obtain the appserver's transaction manager.

  • jndi: An alias for the class. You can configure this runtime to look up the transaction manager at any JNDI location.

See the Javadoc for of each class for details on the bean properties you can pass to these plugins in your configuration string.

Example 13.1. Configuring Transaction Manager Integration

kodo.TransactionMode: managed
kodo.ManagedRuntime: jndi(TransactionManagerName=java:/TransactionManager)