org.multiverse.annotations
Annotation Type TransactionalConstructor


@Retention(value=RUNTIME)
@Target(value=CONSTRUCTOR)
public @interface TransactionalConstructor

Annotation that can be placed on constructor. There is a lot of overlap with the TransactionalMethod annotation, but the big difference is that transactions on constructors can't be retried. So everything related to retrying has been removed.

The reason why this annotation exists is that it is very hard to add the instrumentation in a constructor so that it can be retried. It has to do with a bytecode verification that treats an uninitialized objects as a different type than an initialized one.

Author:
Peter Veentjer.

Optional Element Summary
 boolean automaticReadTracking
          If the transaction automatically should track reads.
 java.lang.String familyName
          The familyname of the transaction.
 boolean preventWriteSkew
          If the write skew problem should be prevented.
 boolean readonly
           
 

readonly

public abstract boolean readonly
Default:
false

familyName

public abstract java.lang.String familyName
The familyname of the transaction. If not set, a familyname will be inferred based on the classname en method signature and in most cases this is the best solution (not providing a value). The family name is not only useful for logging purposes, but als for optimizations like selecting the optimal transaction implementation for that specific set of transactions.

Returns:
the familyname of the transaction
Default:
""

automaticReadTracking

public abstract boolean automaticReadTracking
If the transaction automatically should track reads. This behavior is not only useful to reduce read conflicts, it also is needed for blocking transactions and prevention of the write skew problem.

Returns:
true if it should do automatic read tracking, false otherwise.
Default:
true

preventWriteSkew

public abstract boolean preventWriteSkew
If the write skew problem should be prevented. If set to true, the automaticReadTracking also has to be set to true.

Returns:
true if the writes kew problem should be prevented.
Default:
false


Copyright © 2008-2010 Multiverse. All Rights Reserved.