5 Replies Latest reply on Aug 17, 2007 5:51 AM by tom.baeyens

    wire enlist operation

    porcherg

      In the WireContext, resource objects are auto-enlisted in the Environment transaction.
      We can specify a enlist operation on resource objects. If we specify a enlist operation to the environment transaction, the object is added twice in the transaction, and as a result, the resource is prepared, commit or rolled back twice when the environment is closed.

      Is this behavior normal ?

      Guillaume

        • 1. Re: wire enlist operation
          tom.baeyens

          no should be done only once.

          • 2. Re: wire enlist operation
            porcherg

            Can we change the List of resource in StandardTransaction to a Set or can there be situations where duplicate elements are allowed ?

            Guillaume

            • 3. Re: wire enlist operation
              tom.baeyens

              no. resources should be listed only once. we'll have to fine tune the auto enlisting.

              • 4. Re: wire enlist operation
                porcherg

                I modified auto-enlist to be used only on objectDescriptor (not from references) , and only if no EnlistOperation is defined for this descriptor.

                I have a question about this test:

                EnvironmentFactory environmentFactory = EnvironmentParser.parseEnvironmentFactoryFromXmlString(
                 "<contexts>" +
                 " <application/>"+
                 " <block>" +
                 " <standard-transaction name='transaction' />" +
                 " <standard-transaction name='tx' />" +
                 " <object name='o' class='"+ MyResource.class.getName()+"'>" +
                 " <enlist transaction='tx'/>" +
                 " </object>" +
                 " </block>" +
                 "</contexts>"
                 );


                Is this declaration valid ? Which transaction should be taken as the block context transaction ?

                Guillaume

                • 5. Re: wire enlist operation
                  tom.baeyens

                  if there are more then one standard-transaction in a block, you could add a problem in the parse. behaviour in case of more standard-transactions is irrelevant