When does @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) commit?

后端 未结 2 1274
孤独总比滥情好
孤独总比滥情好 2020-12-23 17:00

An EJB method named Aby calls another EJB method named Bob

Bob is marked with @TransactionAttribute(TransactionAttributeT

2条回答
  •  自闭症患者
    2020-12-23 17:39

    I think A is right. When the method Bob is being called, it creates new transaction for it and method Aby gets suspended until the Bob transaction is committed.

    Also note that it has to be method from some other bean to make it transactional, methods called from the same bean do not act as a business methods.

    See this great article for further explanation.

提交回复
热议问题