SQL Guide : solidDB® SQL statements : MESSAGE : MESSAGE EXECUTE
  
MESSAGE EXECUTE
MESSAGE message_name EXECUTE [COMMITBLOCK block_size_in_rows]
[{OPTIMISTIC | PESSIMISTIC}]
Usage
The MESSAGE EXECUTE statement allows a message to be re-executed on the replica, if the execution of a reply message fails in a replica. 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 is applicable only in advanced replication configurations. It can be issued only on replica databases. On the master database, use the MESSAGE FROM REPLICA EXECUTE statement.
If the reply of the sent message contains REFRESHes of large publications, the size of the REFRESH commit block, that is, the number of rows that are committed in one transaction, can be defined using the COMMITBLOCK property. This has a positive impact on the performance of the replica database. It is recommended that there are no on-line users accessing the database when the COMMITBLOCK property is being used.
In the PESSIMISTIC mode, all other concurrent access to the table affected is blocked until the synchronization message has completed. If you anticipate concurrency conflicts to happen often and the re-execution of the message fails because of a concurrency conflict, you can execute the message using the PESSIMISTIC option for table-level locking; this ensures the message execution is successful.
In the OPTIMISTIC mode, the MESSAGE EXECUTE statement can 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.
Note When working with messages, the autocommit mode must be switched off.
Result set
The MESSAGE EXECUTE statements returns a result set. The returned result set is the same as with command 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 command 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;
Relate reference
MESSAGE FROM REPLICA EXECUTE
See also
MESSAGE