K2 Five 5.3 behavioral change – SmartObjects stored in normalized tables

  • 16 February 2021
  • 0 replies

Userlevel 4
Badge +17

K2 Five 5.3 behavioral change – SmartObjects stored in normalized tables


K2 Five 5.3

K2 Five 5.3 stores SmartObject definitions in normalized SQL tables in the K2 database. This improves performance compared to the method used in previous versions of K2 of storing SmartObject definitions, namely in an XML column. The SmartObject definition table in the K2 Five 5.3 database no longer contains a SmartObjectXML column. Keep in mind that all K2 sites and tools that call SmartObject methods always use the latest version of the SmartObject. The only way in which your solutions might be using an earlier version of a SmartObject is by using custom code.


When upgrading to K2 Five 5.3, the K2 Setup Manager converts the latest version of all SmartObject definitions into normalized SmartObject definition tables. K2 stores prior, unconverted versions of SmartObjects in a backup table called [SmartBroker].[SmartObjectXmlBackup].

When upgrading from an environment that has many SmartObjects, the upgrade may take a while to complete due to this SmartObject definition conversion.

Targeting prior versions of a SmartObject

If you have existing code that uses the SmartObject Client API to call a prior version of a SmartObject (i.e. not the latest version of that SmartObject), you must convert the SmartObject definition of that prior version for your code to continue to work.

Follow these steps to create a new stored procedure in the K2 database to do the conversion, and then convert the SmartObject using the code below:

    1. Download the SQL script from this page
    2. Execute the script in your K2 database. This creates a stored procedure called [SmartBroker].[ConvertSmartObject]
    3. Use the following code to convert each SmartObject that you use in code that is not the latest version:
EXEC [SmartBroker].[ConvertSmartObject] @SmartObjectGuid


0 replies

Be the first to reply!