0 Replies Latest reply on Nov 6, 2012 11:08 AM by Aby V

    Transaction Management across Nodes

    Aby V Newbie

      Hi,

      Given a scenario, I want to put data  D1 to a distributed Cache of infinispan datagrid from a given Node say N1, the data D1 is fetched from Node 2 deployed in another VM( deployed in the same infinispan cluster)  and performed some activity and finally pushed to an RDBMS. The complete activity starting from Node 1 to Node 2 down to data pushed to RDBMS should happen within the same transaction boundary, The activity can be summarized as below

      Cache.

      /** Start of Node 1 Activity **/

       

      TransactionManager manager = globalCache.getCache()

                              .getAdvancedCache().getTransactionManager();

      manager.begin();

      globalCache.putObject("key1", D1);

       

      /**end of Node 1 activity **/

       

      /**Start of Node 2 Activity**/

      TransactionManager manager = globalCache.getCache()

            .getAdvancedCache().getTransactionManager();

      Object D1 =  globalCache.getObject();

         //perform some db activity

          ....

          ....

          ....

      ps.execute( Insert into table( D1))

       

       

      manager.commit();

      /**End of node 2 activity**/

       

       

      With respect to the scenario, I have a few queries?

      1: How a transaction begin from node can proceed with the activity in another node

      2: How transactionManager reference can be shared across difference nodes( is there any way to persist transaction manager reference in cache?)