How to edit the sync.xml?
sync.xml is one of required system configuration files. It defines the stored procedure used to obtain the lock from the DBMS. Since the stored procedure is DBMS-dependent, it is required to define the stored procedure for new DBMS if new DBMS is supplied.
As server.xml, sync.xml file that is included in the distribution jar file. If you want to change it, you have to unzip this file from the jar, and added it back after modification.
Content Convention
This file is described using XML 1.0. The pre-defined XML element are listed below:
XML Tag/Atttribute
Description
<SyncStoredProc> The Root Element <Sybase> Indicates the stored procedure defined under this element is for Sybase. --version the version of Sybase or DB2. <DB2> Indicates the stored procedure defined under this element is for DB2.
Sample File
<SyncStoredProc>
<Sybase version="">
CREATE PROC getDBLock @returnVal int output AS
select @returnVal =0
begin transaction
lock table Sync in exclusive mode nowait
select @returnVal = @@error
if (@returnVal != 0)
rollback transaction
return @returnVal
</Sybase>
<DB2 version="UDB7.0">
CREATE PROCEDURE JodieWu.getDBLock ( OUT returnVal int )
LANGUAGE SQL
P1: BEGIN
DECLARE SQLCODE Integer Default 0;
DECLARE Continue Handler For SQLException Set returnVal =SQLCODE;
DECLARE Continue Handler For SQLWarning Set returnVal =SQLCODE;
DECLARE Continue Handler For NOT FOUND Set returnVal =SQLCODE;
set returnVal = 0;
lock table JODIEWU.Sync in exclusive mode;
END P1
</DB2>
</SyncStoredProc>