I use annotation to record the operation log. But now it is rolled back by @Transactional
. And I use the @Order
annotation but it does not work.
Here is the xml transactional config
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
and this is the operation annotation
@Target({ java.lang.annotation.ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Operation {
public abstract Operator operator();
public abstract String operation();
public abstract String desc();
public abstract OperationLevel level();
}
now it's working, but when an exception happens in createBuy method, @Before
rollback too.