Results 1 to 3 of 3

Thread: One transaction per multiple threads

  1. #1
    Join Date
    Aug 2011
    Posts
    28

    Default One transaction per multiple threads

    The problem is as follows:
    I need to start "global" transaction in certain "main" thread.
    Then a few "child" threads started in "main" thread and all of these threads share that "global" transaction.
    Main thread waits until each of child thread finishes and then commits (or rollbacks) the changes made in the child threads.

    Unfortunately neither the task can be simplified and made single threaded nor the specific changes can be made in data schema, e.g. adding 'validity' flags to the tables the mentioned threads operating with.

    I guess it's possible in JTA as the spec says "Multiple threads may concurrently be associated with the same global transaction." - JTA 1.1, section 3.2, page 13.

    My application is deployed on a pretty ordinary servlet container (Jetty) and one transaction manager is used - DataSourceTransactionManager.
    DB is Oracle (and AFAIK it does support nested transaction so the "shared" transaction is possible, at least theoretically).

    Could you please point me to the right direction?
    Any help is greatly appreciated.

  2. #2
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

    I found these links when Googling for "standalone JTA Transaction Manager"

    http://lightweightyes.blogspot.com/2...-managers.html

    <sorry for the JBoss link, but hell I was a JBoss employee for a couple years.>
    https://community.jboss.org/wiki/How...sactionManager

    http://stackoverflow.com/questions/2...-for-hibernate

    All point to many standalone JTA TX Managers.

    Good Luck

    Mark

  3. #3
    Join Date
    Aug 2011
    Posts
    28

    Default

    Thanks a lot!

    After digging deeper at this question I decided to refuse this architecture and rather prepare to face potential performance problem and if facing one deal with it in another, less complicated way being with the pretty standard approach to transactions management

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •