Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Multiple update operations to different dataSources in one queue - transactions

    Hello there,

    This is general question regarding how transactions work in SC. I'm currently working with project where we need (or at least we think we need ;) global transactions ). I just need to clear some things up in my head for this.

    Let's say we have two sql datasouces A and B pointing to different databases.

    User starts queue and sends two updates one for A and the other for B. Lets say SC first processes update call to A and then to B. But call to B fails upon committing let's say it happens because server crashes just after commit to A.



    1.How transactions work for this scenario.?

    2. When I execute above queue scenario but this time A is sql DS and B is hibernate DS via spring managed SessionFactory (not beanless) then (correct me if I'm wrong):

    a)there are two different transactions: sql DS uses its own tx handling via local transactions on connection and call to update to B DS uses hibernate/spring configured transaction manager?

    3. We want to use JTA transaction manager with XA support to every operation that spans multiple DS-es. Is our only option to use custom operation bindings and delegating everything manually to Spring services? Is there any way we can use built in DS operations mixed with custom DS operations which delegates to stored procedures but both using the same transaction manager?

    Example scenario is like this:
    1 You have product details DynamicForm bound to A (sql ds) and change some details there before calling saveData on it.
    2. When saving changes we want to perform DS add operation on another generic datasource (this is different database). This second add operation is bound in ds.xml file to transactional spring service.
    We do this in one queue

    Is there any way to do this while reusing SC logic for first operation? I suppose not if this is A is sql type

    Would it help to have A ds changed to Hibernate datasource, will SC use spring transaction manager then?


    Thanks for help.
    You did excellent job with SC, keep up good work.
    Łukasz

    #2
    Hi again,

    can you please clarify how transactions work when you have two DS operations to different databases in one queue?

    lkc

    Comment


      #3
      If there are to different databases (eg MySQL and Oracle) they are not automatically combined into a transaction - this requires JTA as you've noted.

      If you wanted a feature to be able to provide an externally acquired SQLConnection or HibernateSession to a DataSource to make it possible to join a JTA transaction initiated by your own code, that would a valid and relatively small Feature Sponsorship.

      Comment


        #4
        Thanks for help.

        So how do I contribute? I don't have access to any buildable distro.

        lkc

        Comment


          #5
          Feature Sponsorship is described here.

          Comment

          Working...
          X