Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-981

Annotation support for transaction bridging

    XMLWordPrintable

Details

    Description

      Vision

      The grand plan for this feature is to support near transparent bridging, end-to-end irrespective of what transport and component technology is used. The only caveat being that the transport and component technologies support a compatible transaction model. The basic case would be to always bridge when possible and for this scenario the absolute bare-minimum number of annotations should be used. More specific bridging requirements should be specified through annotations.

      Example

      This example shows what is considered the default scenario. It requires very few annotations.

      1. Some client code (A JSF managed bean, for example) has a client to Service1 injected.
      2. The managed bean begins a transaction somehow.
      3. Service1 uses WSPolicy to state that it requires a WSAT transaction to be in place.
      4. Somehow (maybe during injection or when CXF handles the PolicyAssertion) the injected client stub for Service1 has the TXBridge and XTS interceptors configured.
      5. The managed bean invokes a method on Service1.
      6. The JTA transaction is bridged to a WS-AT transaction and the Web service request is made.
      7. Service1 specified by an annotation that it requires a transaction (this was how the WS-Policy assertion was placed in the WSDL) and thus the XTS and TXBridge interceptors are inserted.
      8. The incoming WS-AT context is detected and bridged onto a JTA transaction.
      9. Service1 updates a DB and the associated XAResource is enlisted with the JTA transaction.
      10. Service1 then invokes the client of Service2.
      11. Service2 does not specify that it requires a WS-AT transaction, via a WS-Policy assertion. Therefore the client to Service2 must be annotated to specify that it requires WS-AT transaction out-flow.
      12. When invoking a method on the Service2 client it is detected that a WS-AT transaction is already in-place and this is used, rather than bridging again from JTA back to WS-AT.

      Similar behaviour should occur for REST and JTS transactions also.

      Advanced features

      This section describes some of the more advanced features that could be supported. As these features deviate from the default scenario, they are all specified via annotations.

      Specific "bridged from" protocol

      In the default scenario the transaction protocol bridged from is inferred by the transaction context present when the service is invoked. As a result any supported transaction will enact bridging. Some services may need to limit the types of transactions they bridge from. For example, only enable bridging if a WS-BA transaction is in place prior to service invocation.

      Specific "bridged to" protocol

      The default is to always bridge to JTA for incoming bridging. However, this could be inefficient if a Web service always invokes another Web service, both requiring WS-AT. There may be other situations where bridging to JTA is not appropriate.

      Disable bridging

      The service may wish to prevent bridging altogether. For example if no transactional work needs to be done within a different type of transaction.

      Attachments

        Activity

          People

            paul.robinson@redhat.com Paul Robinson
            paul.robinson@redhat.com Paul Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: