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 readonly
          If the TransactionalConstructor should be readonly or an update.
 TraceLevel traceLevel
          With the TraceLevel you can see what is happening inside a transaction.
 boolean trackReads
          If the transaction automatically should track reads.
 boolean writeSkew
          If the write skew problem is allowed to happen.
 

readonly

public abstract boolean readonly
If the TransactionalConstructor should be readonly or an update.

Returns:
true if readonly.
Default:
false

trackReads

public abstract boolean trackReads
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

writeSkew

public abstract boolean writeSkew
If the write skew problem is allowed to happen. If set to false, the readtracking also has to be set to true otherwise you will get an Exception.

Returns:
true if the writeSkew problem is allowed.
Default:
true

traceLevel

public abstract TraceLevel traceLevel
With the TraceLevel you can see what is happening inside a transaction.

Returns:
the TraceLevel.
Default:
org.multiverse.api.TraceLevel.none


Copyright © 2008-2010 Multiverse. All Rights Reserved.