Results 1 to 10 of 12

Thread: Transaction Management in Spring-Integration framework

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    15

    Default Transaction Management in Spring-Integration framework

    I'm browsing Integration frameworks to choose the best one for my integration problem. one thing that I want to know is transaction management in multiple application integration context, supported or not ? and if it does, how ? in Pro Spring Integration I didn't find a clear solution they just put sth like

    Code:
    <int:poller fixed-rate="1000">
    <int:transactional/>
    </int:poller>
    and I couldn't understand how this manage transaction along multiple application ?

    could anyone expert in these frameworks help me to find out to know that how transaction management and recovery in case of error in any application that transaction is executing can be done using these frameworks ? for example consider this scenario : application A initiate transaction and use applications B and C in middle and finally do sth after B and C and commit it, if in this scenario application c fails or throw an exception, is there anyway to rollback transaction in B and A and how ?

  2. #2
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    When you said multiple application contexts, do also mean they are not executing on the same Virtual machine and are remote to each other? Can you explain your use case in more details?

    To answer your question if invocations on beans from different application context can be executed in one transaction? Yes, it is possible but will need to know your use case for that.

  3. #3
    Join Date
    May 2010
    Posts
    15

    Default

    Quote Originally Posted by Amol Nayak View Post
    When you said multiple application contexts, do also mean they are not executing on the same Virtual machine and are remote to each other? Can you explain your use case in more details?
    Yes. I mean remote to each other and multiple applications even may using different technologies or spring-integration.
    Last edited by iramin; Mar 4th, 2012 at 01:17 AM.

  4. #4
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    As far as transaction manager is concerned, JTA transaction manager is what you need to use for sure.
    How are you planning to perform communication between these remote applications? If you use HTTP or even JMS for communication, you cannot pass the transaction context from one node to another.
    I feel you giving some more details about the application you want to design can help narrow down the suggestions.

  5. #5
    Join Date
    May 2010
    Posts
    15

    Default

    Quote Originally Posted by Amol Nayak View Post

    To answer your question if invocations on beans from different application context can be executed in one transaction? Yes, it is possible but will need to know your use case for that.
    my scenario is sth like this :
    Code:
    confirmScenario(T entity){
    
    localBean.validate(entity);
    localBean.process(entity);
    legacySystemA.validate(entity);
    legacySystemB.process(entity);
    externalPaymentService.doPayment(entity);
    .
    .
    .
    
    }
    I want to know is there anyway to make this scenario transactional ?
    communication with external systems is almost with Web Service, but in case of communication with our legacy systems we haven't decided yet, if special communication way such as JMS can help us and Web Service doesn't, we can use those communication methods.
    Last edited by iramin; Mar 4th, 2012 at 01:37 AM.

  6. #6
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Based on what i see, validate possibly just validates some records and perhaps does not affect the state if the entity, the process method localBean and legacySystemB needs to succeed when the doPayment runs successfully else both needs to rollback. Is my understanding correct?

    For this to happen, the resource adapter of your legacy system should be XA compliant and can participate in a distributed transaction. I don't know what your localBean does, but if it is some kind of database operation, it should not be a problem.

    If your legacy system is XA compliant, then JTA transaction manager is what you need to use.

  7. #7
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    You cannot use JMS for communication as the transaction on client will just ensure sending of the message to the queue, the remote operation that happens after the message is picked up by the receiver and processed will not be a part of the transactions initiated by the client.
    EJBs however do support propagation of the transaction context.

  8. #8
    Join Date
    May 2010
    Posts
    15

    Default

    Quote Originally Posted by Amol Nayak View Post
    Based on what i see, validate possibly just validates some records and perhaps does not affect the state if the entity, the process method localBean and legacySystemB needs to succeed when the doPayment runs successfully else both needs to rollback. Is my understanding correct?

    For this to happen, the resource adapter of your legacy system should be XA compliant and can participate in a distributed transaction. I don't know what your localBean does, but if it is some kind of database operation, it should not be a problem.

    If your legacy system is XA compliant, then JTA transaction manager is what you need to use.
    thanks for your help. I think I need these requirements.
    can you provide me some links or tutorials for using transaction managers in such a scenario that work with multiple applications for example using Web Services?
    Last edited by iramin; Mar 4th, 2012 at 02:06 AM.

  9. #9
    Join Date
    May 2010
    Posts
    15

    Default

    Quote Originally Posted by Amol Nayak View Post
    Based on what i see, validate possibly just validates some records and perhaps does not affect the state if the entity, the process method localBean and legacySystemB needs to succeed when the doPayment runs successfully else both needs to rollback. Is my understanding correct?

    For this to happen, the resource adapter of your legacy system should be XA compliant and can participate in a distributed transaction. I don't know what your localBean does, but if it is some kind of database operation, it should not be a problem.

    If your legacy system is XA compliant, then JTA transaction manager is what you need to use.
    if communication with other application is implemented by Web Service, does transaction can be handled by XA protocol ?

  10. #10
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Some transaction managers like Jboss's transaction manager or Atomikos do. Infact atomikos also provides propagation of transaction over JMS (but you need to use a Non XA JMS adapter)
    But I haven't used any of these personally so can't make any suggestions.

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
  •