Home

SYNCHRONIZE should not be used

Description

    The SYNCHRONIZE rule states that the SYNCHRONIZE keyword should not be used in PL/SQL code. This keyword is used to ensure that all transactions are synchronized with the database, and can cause performance issues if used incorrectly. To avoid this, developers should use other methods to ensure that transactions are properly synchronized with the database. This could include using the COMMIT command, or using the DBMS_LOCK package.

Key Benefits

  • No Data Loss: SYNCHRONIZE should not be used because it can cause data loss due to the fact that it does not guarantee that both the source and destination will be synchronized.
  • No Unnecessary Data Transfer: SYNCHRONIZE should not be used because it can cause unnecessary data transfer due to the fact that it will transfer all data from the source to the destination, regardless of whether or not the data has changed.
  • No Unnecessary Overhead: SYNCHRONIZE should not be used because it can cause unnecessary overhead due to the fact that it will transfer all data from the source to the destination, regardless of whether or not the data has changed.

 

Non-compliant Code Example

PROCEDURE UpdateCustomeCity(customerId in integer, city in nvarchar2(200))
IS
BEGIN
UPDATE CUSTOMERS
		SET City=city
		WHERE Id = customerId;
  
	SYNCHRONIZE;        --Non compliant code (SYNCHRONIZE is used)
	
END UpdateCustomeCity;
Visual Expert 2024
 VEPLSQLRULE133