solidDB Help : solidDB reference : SQL: Statements : MESSAGE : MESSAGE EXECUTE
  
MESSAGE EXECUTE
Note Applies to only solidDB Advanced Replication configurations.
MESSAGE message‑name EXECUTE [COMMITBLOCK block‑size‑in‑rows]
   [{
OPTIMISTIC | PESSIMISTIC}]Usage
Use the MESSAGE EXECUTE statement to re-execute a message on the replica database if the execution of a reply message fails in a replica database. The execution of a reply message can fail, for example, if the database server detects a concurrency conflict between a refresh and an ongoing user transaction.
The MESSAGE EXECUTE statement can be executed only on replica databases. On the master database, use the MESSAGE FROM REPLICA EXECUTE statement, see MESSAGE FROM REPLICA EXECUTE.
Note When working with messages, autocommit mode must be switched off.
Parameters, clauses, keywords, and variables
COMMITBLOCK: Indicates the number of rows that are processed before the data is committed. By default, the MESSAGE EXECUTE statement commits all rows as one transaction. If the reply of the sent message contains refreshes of large publications, include the COMMITBLOCK keyword in order to commit the data in more than one transaction and ensure good performance for the operation. It is recommended that there are no on-line users accessing the database when the COMMITBLOCK keyword is used.
OPTIMISTIC | PESSIMISTIC: Include the PESSIMISTIC keyword so that the MESSAGE EXECUTE statement uses table-level pessimistic locking when it is initially executed (see Pessimistic and optimistic concurrency controls). If the PESSIMISTIC mode is specified, all other concurrent access to the table is blocked until the synchronization message has completed. If you use OPTIMISTIC mode, the MESSAGE EXECUTE statement might fail due to a concurrency conflict.
When a transaction acquires an exclusive lock to a table, the General.TableLockWaitTimeout parameter determines the wait period of the transaction after which the exclusive or shared lock is released, see General section.
Result set
The MESSAGE EXECUTE statements returns a result set. The returned result set is the same as with the statement MESSAGE GET REPLY, see MESSAGE GET REPLY.
The columns of the result set are as follows:
 
Column name
Description
Partno
Message part number
Type
The type of result set row. Possible types are:
0: Message part start
1: This type is not in use
2: The message was a propagation message and the status of that operation is stored in the return message
3: Task
4: Subscription task
5: Type of refresh (FULL or INCREMENTAL)
6: MESSAGE DELETE status
Masterid
Master ID
Msgid
Message ID
Errcode
Message error code. Zero if successful.
Errstr
Message error string. NULL is successful.
Insertcount
Number of inserted rows to replica.
Type=3: Total number of insert
Type=4: Row inserts restored from replica history to replica base table
Type=5: Insert operations received from master
Deletecount
Type = 3: Total number of deletes
Type = 4: Row deletes restored from replica base table
Type = 5: Delete operations received from master
Bytecount
Size of message in bytes. Indicated in result received from statement MESSAGE END. Otherwise 0.
Info
Information of the current task. Type = 0: then Message name Type = 3: Publication name Type = 4: Table name Type = 5: FULL/INCREMENTAL
Return values
 
Error code
Description
13XXX
Table level error
10006
Concurrency conflict (simultaneous other operation)
13047
No privilege for operation
13056
Insert not allowed for pseudo column
25005
Message message‑name is already active
25013
Message name message‑name not found
25018
Illegal message state
25024
Master not defined
25026
Not a valid master user
25031
Transaction is active, operation failed
25035
Message message‑name is in use
A user is currently creating or forwarding this message.
25040
User id user‑id is not found
While executing a message reply an attempt to map a master user to a local replica id failed.
25041
Subscription to publication publication‑name not found
25048
Publication publication‑name request info not found
25056
Autocommit not allowed
Example
MESSAGE MyMsg0002 EXECUTE;
Go up to
MESSAGE