RW-RO Mode Switching Services
These services are located in the com.ataccama.nme.internal.engine.services.handlers.ReadWriteControlServiceBundle service bundle and are available only if VLDB persistence is used.
They allow external applications to switch data access mode between RW and RO.
| Only one MDM instance can operate on a database storage in the RW mode at a time. An external application should guarantee this, otherwise data corruption and inconsistencies can occur. This service should not be used when MDM operates in High Availability mode. | 
Initial data access mode is defined by runtime parameters.
<service class="com.ataccama.nme.internal.engine.services.handlers.ReadWriteControlServiceBundle" />| We use a placeholder instance entity Example, a placeholder master entityExample, and a placeholder Master ViewMvto illustrate the functionality of services. | 
switchReadWriteMode
Starts the switch to the given target mode.
<switchReadWriteMode>
  <targetMode>RO</targetMode>     <!-- target mode can be RO (read-only) or RW (read-write) -->
  <switchMode>WAIT</switchMode>   <!-- must be WAIT in this version, reserved for future use -->
</switchReadWriteMode>The service returns immediately, starting switch action asynchronously.
The response contains either OK and the current mode, or ERROR and an error message (if starting the switch failed).
| The OKresponse does not mean the switch is successful: the switch action is complex and can fail after the response. | 
A switch to RO waits for completion of the active RW operation (load, export, processDelta). A switch to RW checks the transaction state of the storage and might perform a recovery.
<switchReadWriteModeResponse>
  <result>OK</result>
  <message>SWITCHING_TO_RO</message>  <!-- if switch has already finished, message is "RO" -->
</switchReadWriteModeResponse>getReadWriteMode
Returns the data access mode of this instance. The request is empty.
<getReadWriteMode>
</getReadWriteMode>The service returns the current data access mode, which can be one of the following: RW , RO, SWITCHING_TO_RO, SWITCHING_TO_RW.
<getReadWriteModeResponse>
  <readWriteMode>RO</readWriteMode>
</getReadWriteModeResponse>Was this page useful?