1.11. Transactions

1.11.1. How does Kodo use transactions?
1.11.2. Does a Kodo transaction translate directly to a database transaction?
1.11.1.

How does Kodo use transactions?

The JPA specification defines a javax.persistence.EntityTransaction interface that is similar to a JTA transaction. The JPA application will begin a transaction before making changes to objects, and then commit (or rollback) the transaction once the operation is complete. JPA does not mandate any specific transaction demarcation boundries; the application is free to begin and end transactions in the way that the developer deems suitable. See Chapter 9, Transaction.

The JDO specification defines a javax.jdo.Transaction interface that is similar to a JTA transaction. The JDO application will begin a transaction before making changes to objects, and then commit (or rollback) the transaction once the operation is complete. JDO does not mandate any specific transaction demarcation boundries; the application is free to begin and end transactions in the way that the developer deems suitable. See Chapter 9, Transaction.

Kodo can also integrate with your application server's managed transactions.

1.11.2.

Does a Kodo transaction translate directly to a database transaction?

Not necessarily. For optimistic transactions, Kodo will typically only begin a database transaction when the Kodo transaction is committed, or if changes are manually flushed to the database.

 

Skip navigation bar   Back to Top