@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface Transactional
Defines that the class is to be managed within a transactional
container. Unless specified using other annotations, all public
methods will be assumed to modify the state of the object, i.e.,
require write locks. The only state that will be saved/restored is that
which is marked using the @State annotation or SaveState/RestoreState.
This assumes currently that all state modification and locking occurs through
public methods. This means that even if there are private, protected or
package scope methods that would change the state, they will not be tracked.
Therefore, the implementation class should not modify state unless by calling
its own public methods.
All methods should either be invoked within a transactional context or have
the Nested annotation applied, wherein the system will automatically create a
new transaction when the method is invoked.
- Author:
- marklittle