Announcement Announcement Module
Collapse
No announcement yet.
TransactionProxyFactoryBean proxied method & thread Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • TransactionProxyFactoryBean proxied method & thread

    Hello,

    I have a thread-safe method which uses sqlMapClientTemplate to return a list directly. If I wrap the method using TransactionProxyFactoryBean (PROPAGATION_REQUIRED, readOnly), will it still be thread safe? FYI, the bean is a singleton and will be used in web application.

    Please help me, I am a newbie.

    Billy

  • #2
    Yes. Adding declarative transactions through Spring is thread safe. They use a Java concept called ThreadLocal which keeps any variables global to the transaction only in the thread its executing.

    Comment


    • #3
      Thank you. Spring is great! :lol:

      Comment

      Working...
      X