page1
Spring: demarcação transacional declarativa
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Transactional(
value = "txManager",
readOnly = true,
propagation = Propagation.REQUIRED,
isolation = Isolation.READ_COMMITTED,
rollbackFor = {Throwable.class}
)
public @interface WithReadOnlyTx {}
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Transactional(
value = "txManager",
readOnly = false,
propagation = Propagation.REQUIRED,
isolation = Isolation.SERIALIZABLE,
rollbackFor = {Throwable.class}
)
public @interface WithReadWriteTx {}
meta-annotations