This topic describes the exclusive lock that a messaging engine maintains on its data store and the problems that can arise with exclusive access locking.
Each messaging engine establishes an exclusive lock on its data store. While the messaging engine is running, it maintains that lock to ensure the integrity of the data within the data store.
The data store lock uses database locks and so is an intrinsic part of the data store itself. The relational database management system (RDBMS) relies on the JDBC infrastructure or underlying TCP/IP protocol to indicate that the failure of a messaging engine or application server. The RDBMS can then automatically release the data store locks in the database.
The SIBOWNER table in the data store holds the lock as a pair of unique identifiers in a single row. When it starts, a messaging engine uses these two identifiers to acquire and maintain its exclusive lock:
These identifiers determine which messaging engine is using a data store. These identifiers also determine whether a running instance of a messaging engine has maintained its exclusive lock for the time period during which it was running.
As a messaging engine starts, it obtains an exclusive table lock on the SIBOWNER table. The messaging engine expects to find a single row of data in the table, or no data. If there is an existing row, the messaging engine starts only if the MEUUID it finds matches its own unique identifier. If the MEUUID does not match, the messaging engine writes error message CWSIS1535 to the server's error log and the messaging engine fails to start.
If there are no rows in the SIBOWNER table, the messaging engine inserts one row containing its own MEUUID and INCUUID. If there is a single row in the table and the MEUUID matches the unique identifier for the messaging engine, it updates the INCUUID with its own incarnation identifier and attempts to obtain a new table lock on the SIBOWNER table. The messaging engine checks again that the INCUUID still matches its own incarnation identifier, in case another instance of the same messaging engine on another server is starting at the same time. If the INCUUID in the table does not match, the messaging engine fails to start.
The exclusive lock remains until the messaging engine stops, with periodic refreshes to ensure that the lock is still in force. If the messaging engine cannot refresh the lock, the messaging engine is not permitted to use the data store while the messaging engine attempts to acquire the lock again. If the messaging engine discovers from the data in the SIBOWNER table that another messaging engine incarnation is using the data store, the messaging engine writes error message CWSIS1519 to the server's error log and the messaging engine stops immediately.