Vote up!
0 Votes
0 Replies

not validating integrity transaction

Problem posted by Diego Malpartida on Mar 02, 2017 17:14 EST

When trying to insert a new record, the transaction should validate that the foreign keys exist. However, this is not happening. The function kony.sync.checkIntegrity (shown below) should lead to the function integrityTransaction, where the foreign keys are validated. However, it never enters this function. Why could this be happening?   kony.sync.startTransaction = function (connection, transactionCallBack, successCallBack, errorCallBack) { sync.log.trace("Entering kony.sync.startTransaction "); kony.db.transaction(connection, transactionCallBack, errorCallBack, successCallBack); }; kony.sync.checkIntegrity = function (dbname, rMap, successCallback, errorCallBack) { sync.log.trace("Entering kony.sync.checkIntegrity "); if(!kony.sync.enableORMValidations){ kony.sync.verifyAndCallClosure(successCallback); return; } var status = true; var isError = false; var integrityFailedMap = null; var connection = kony.sync.getConnectionOnly(dbname, dbname, errorCallBack, "Checking integrity"); if(connection !== null){ kony.sync.startTransaction(connection, integrityTransaction, integritySuccess, integrityFailure, "Checking Referential Integrity Constraints"); } function integrityTransaction(tx) { integrityFailedMap = kony.sync.checkIntegrityinTransaction(tx,rMap); } function integritySuccess() { var error = ""; if (integrityFailedMap === true) { kony.sync.verifyAndCallClosure(successCallback); } else{ for(var key in integrityFailedMap){ error = error + integrityFailedMap[key]; } kony.sync.verifyAndCallClosure(errorCallBack, kony.sync.getErrorTable(kony.sync.errorCodeReferentialIntegrity, error)); } } function integrityFailure() { if (!integrityFailedMap) { kony.sync.showTransactionError(errorCallBack,"Checking integrity"); }else{ kony.sync.verifyAndCallClosure(errorCallBack, kony.sync.errorObject); kony.sync.errorObject = null; } } };

Posted In
Kony Inc Kony Sync