odavid / typeorm-transactional-cls-hooked

A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS
MIT License
524 stars 86 forks source link

what is the default Propagation? #34

Closed Diluka closed 3 years ago

Diluka commented 4 years ago

I use default Propagation which pass nothing to @Transactional(). I consider it is REQUIRED. But when I use a decorated method to call another decorated method cause a deadlock. TypeORM logs two START TRANSACTION. it means the default Propagation is REQUIRES_NEW? Or it is a bug?

odavid commented 4 years ago

Hi @Diluka, the default propagation is REQUIRED. Looking at the code, I don’t really see a way for this behavior to happen. I will be afk for quite long time, so I cannot test that at the moment. Will try to when I have the chance, but since I tested that before and nothing changed in that area, I doubt I can reproduce that. Can it be that you are running another asynchronous transaction?

Diluka commented 4 years ago

just use this trans, maybe typeorm dont support nested

EL PYS CONGROO


发件人: Ohad David notifications@github.com 发送时间: 星期三, 十二月 4, 2019 5:25 下午 收件人: odavid/typeorm-transactional-cls-hooked 抄送: Diluka; Mention 主题: Re: [odavid/typeorm-transactional-cls-hooked] what is the default Propagation? (#34)

Hi @Dilukahttps://github.com/Diluka, the default propagation is REQUIRED. Looking at the code, I don’t really see a way for this behavior to happen. I will be afk for quite long time, so I cannot test that at the moment. Will try to when I have the chance, but since I tested that before and nothing changed in that area, I doubt I can reproduce that. Can it be that you are running another asynchronous transaction?

― You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/odavid/typeorm-transactional-cls-hooked/issues/34?email_source=notifications&email_token=AA4XORBNK6UPWRD4CJ3IMKLQW5ZPRA5CNFSM4JVE3E52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF4JU2Y#issuecomment-561551979, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA4XORGPY25NR3NCOLWT7A3QW5ZPRANCNFSM4JVE3E5Q.