org.multiverse.annotations
Annotation Type FieldGranularity


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface FieldGranularity

Annotation that can be placed above a field to indicate that the STM should use a field level granularity instead of object level granularity. If you have a transactional object with 2 mutable fields, 2 transactions could conflict even if they are writing to a different one. This reduce this 'unneeded' failure, this annotation can be placed on fields.

Under water these fields are transformed to transactional references or transactional primitives.

  &at;TransactionalObject
  class Person{
      &at;FieldGranularity
      private String name;
      &at;FieldGranularity
      private int age;
  }
 

This is transformed to:

 &at;TransactionalObject
 class Person{
     private final TransactionalReference<String> name = new ...
     private final TransactionalInteger age = new ...
 }
 

Author:
Peter Veentjer.



Copyright © 2008-2010 Multiverse. All Rights Reserved.