@Transactional propagation on private methods @Transactional propagation on private methods spring spring

@Transactional propagation on private methods


  1. If myPrivateMethod is called from public method that is annotated @Transactional it is propagated.
  2. If first condition is TRUE yes it will roll-back.
  3. It is misconception to compare isolation level on database and synchronization of class method. They shouldn't be compared at all. If your method will be used in multi-thread env you should synchronize method(be aware in some circumstances it is not enough to have thread safe code). Isolation level SERIALIZABLE is used on database level. It is most restrictive isolation level, and it can lock a lot of tables when you run some query, before it is is done, to help your data not turn to some inconsistent state. You should be sure that you need this level of isolation because this can lead to performance issues. So answer is NO.