2016/02/07 - Apache Onami has been retired.

For more information, please explore the Attic.

public abstract @interface

Transactional

implements Annotation
org.apache.onami.persist.Transactional

Class Overview

Marks a method or class to be executed within a transaction.

This will span a new transaction around the method unless there is already a running transaction. In the case that there is a running transaction no new transaction is started. If a rollback happens for a method which did not start the transaction the already existing transaction will be marked as rollbackOnly.

Guice uses AOP to enhance a method annotated with @Transactional with a wrapper. This means the @Transactional only works as expected when:

  • The object on which the method is called has been created by guice.
    This can be achieved by having it (or a Provider) injected into your class or by calling getInstance(Class) or getInstance(Key).
  • The method which should be run transactional is not private, not static and not final.

Summary

[Expand]
Inherited Methods
From interface java.lang.annotation.Annotation