Code Monkey home page Code Monkey logo

Comments (3)

Yiseull avatar Yiseull commented on September 4, 2024

참고

from dev-qna.

Yiseull avatar Yiseull commented on September 4, 2024

포인트 지급 로직을 Event로 처리한 후, 팀원에게 "여기에 비동기처리는 필요 없을까요?" 라는 리뷰를 받았다.

image


나는 비동기 처리할 경우 별도의 스레드로 실행되어 다른 트랜잭션에서 실행될 뿐, 더 자세한 내용은 몰랐는데 팀원이 TransactionSynchronizationManager 를 알려주었다. TransactionSynchronizationManager은 트랜잭션의 정보를 ThreadLocal로 관리하여 동일 스레드 내에서 트랜잭션의 동기화를 도와주는 트랜잭션 동기화 매니저이다.

정리하면 아래와 같다.

1. 비동기로 처리하게 되면 별도의 스레드에서 트랜잭션 실행
2. TransactionSynchronizationManager는 스레드마다 독립적으로 Connection을 관리하기 때문에 다른 스레드는 같은 트랜잭션 사용 불가능
=> 비동기 처리 불가능

from dev-qna.

Yiseull avatar Yiseull commented on September 4, 2024

이 내용을 블로그에 옮겨 적었다! 😁
https://yiseull.tistory.com/31

from dev-qna.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.