Show TOC

Exactly Once in Order in Multiple LUWsLocate this document in the navigation structure

Use

'In order processing' can be performed using persistent sequences across multiple LUWs.

The lifecycle of persistent sequences is independent from the application program. Each persistent sequence belongs to exactly one logical port (exactly one proxy class).

Note

A logical port represents the client view of a service endpoint. A service endpoint is a callable entity and represents a Web service externally. The relation between the logical port and the service endpoint is 1.1.

If a persistent sequence is used, all method calls are transferred to this sequence at COMMIT. The method calls of a persistent sequence are performed in the order of the triggered COMMITS. The calls occur in a sequence in the pre-defined order.

data:

  l_proxy type ref to co_my_proxy,

  l_sequ_prot type ref to if_wsprotocol_sequence,

  l_sequence type ref to if_ws_persistent_sequence,

  l_sequ_id type srt_seq_id.

create object l_proxy.

  l_sequ_prot ?= l_proxy->get_protocol(if_wsprotocol=>sequence).

  l_sequence = l_sequ_prot->create_persistent_sequence( ).

  l_sequ_id = l_sequence->get_id( ).

  l_sequence->begin( ).

  l_sequ_prot->set_client_sequence(l_sequence ).

  l_proxy->m1( ).

  l_proxy->m2( ).

  l_sequence->end( ).

<<commit>>

  l_sequence = l_sequ_prot->reuse_persistent_sequence( l_sequ_id ).

  l_sequence->begin( ).

    l_sequ_prot->set_client_sequence( l_sequence ).

    l_proxy->m1( ).

    l_proxy->m2( ).

  l_sequence->end( ).

<<commit>>

  l_sequence->terminate().

<<commit>>

While transient sequences can be used only once and are completed at the end of a LUW, persistent sequences - on the other hand - can be reused.

If you have a new LUW, a protocol needs to be created (see above). For this protocol, you call the method reuse_persistent_sequence( ).

An ID, which can be determined after a sequence has been created using GET_ID( ), is transferred to this method.

Afterwards, the start of the sequence is made known through the method begin( ) and the sequence is registered at the protocol.

If a persistent sequence is no longer required, it can be deleted with terminate (). Transient sequences do not need to be terminated explicitly.