@Transactional in Spring Mybatis

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

@Transactional in Spring Mybatis

Swapna Ravi

Hi


I have 2 transactions which accepts same input as below.


insert/update to Table A (int ID)
if above is success then insert to Table B (int ID)


If table B insert fails, the insert/updates to Table A should NOT roll back.
But if insert/update to table A fails, insert to table B should not happen.


How do I achieve with @transactional propagation & isolation levels?

Thanks
Swapna R

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/8b6d916e-85f1-48e8-ac4b-6f7b3e3a8bbd%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: @Transactional in Spring Mybatis

Kazuki Shimizu
Could you provide a small reproduce project?

On Wednesday, May 13, 2020 at 9:15:35 PM UTC+9, Swapna Ravi wrote:

Hi


I have 2 transactions which accepts same input as below.


insert/update to Table A (int ID)
if above is success then insert to Table B (int ID)


If table B insert fails, the insert/updates to Table A should NOT roll back.
But if insert/update to table A fails, insert to table B should not happen.


How do I achieve with <a href="https://github.com/transactional" style="background-color:initial;color:rgb(36,41,46);font-weight:600;white-space:nowrap" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ftransactional\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcb_i_lRTyfqECocDAgqTI_XwI_w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Ftransactional\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcb_i_lRTyfqECocDAgqTI_XwI_w&#39;;return true;">@transactional propagation & isolation levels?

Thanks
Swapna R

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/cd230723-d908-4aad-9ba2-bee020c9653f%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: @Transactional in Spring Mybatis

Swapna Ravi
Without any @ transactional by default my use case works. Is that fine ..

On Sun, May 17, 2020, 8:08 AM Kazuki Shimizu <[hidden email]> wrote:
Could you provide a small reproduce project?

On Wednesday, May 13, 2020 at 9:15:35 PM UTC+9, Swapna Ravi wrote:

Hi


I have 2 transactions which accepts same input as below.


insert/update to Table A (int ID)
if above is success then insert to Table B (int ID)


If table B insert fails, the insert/updates to Table A should NOT roll back.
But if insert/update to table A fails, insert to table B should not happen.


How do I achieve with @transactional propagation & isolation levels?

Thanks
Swapna R

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/cd230723-d908-4aad-9ba2-bee020c9653f%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CACdW%2BhA90JEnuKXkUw4qKsK7OQaxHs-Ry4dD-Dq8RyiZaruSwg%40mail.gmail.com.