Starting Campaign Classic 18.4, the ID generation mechanism has been enhanced to increase the lifespan of Campaign instances with large volumes of objects.
This article describes:
- the Sequence auto-generation feature
- the new API GenCreateOrUpdateSchemaSequenceDDL
- the change of sequence use for some built-in schemas
In Campaign Classic, schema ID values can be generated automatically by setting autopk="true" in the root element.
In case of autopk="true", the ID will use the sequence name passed in the attribute pkSequence. When the pkSequence is missing, by default, Campaign Classic uses the built-in XtkNewId sequence.
|Attributes||ID generation mode||pkSequence available||pkSequence missing|
|autopk="true"||Automatic||Use specified sequence||Use XtkNewId sequence|
|autopk="false" or no attribute||Manual||N/A||N/A|
The main purpose of this feature is to avoid, as much as possible, to use XtkNewId sequence, especially for custom schemas and for some built-in schemas (XtkWorkflowLog, etc.). Instead, we will generate dedicated sequences for them.
A custom autopk schema is a schema not having built-in namespace (i.e. nl, nms, xtk, crm or ncm), with autopk="true" and without specified pkSequence.
- Supported databases engines: PostgreSQL, Oracle and MSSQL.
- This feature does not apply to external schemas (FDA).
- Extended schemas will continue to use their parent schemas' sequences.
If a custom autopk schema is created AFTER the value of XtkSequence_AutoGeneration, a dedicated sequence will be auto-generated during the generation of the schema.
This sequence will be named: auto_<nameSpace><schemaName>_seq.
If the auto-generated sequence name has more than 30 characters, we will moderate the part <nameSpace><schemaName> using CRC32.
This feature is implemented through a new API: GenCreateOrUpdateSchemaSequenceDDL. This API generates the SQL script used to create or update autopk schema sequence:
GenCreateOrUpdateSchemaSequenceDDL(schemaID, newSequenceName, oldSequenceName) schemaID (mandatory): "<nameSpace>:<schemaName>" newSequenceName (mandatory): new sequence name oldSequenceName (optional): old sequence name
- Generally, this API is used to create autopk schema sequence, in which case oldSequenceName is empty. For example, when creating a custom autopk schema, we call internally this API with its schemaID and the auto-generated sequence name, then update the database structure to create the sequence in the database.
GenCreateOrUpdateSchemaSequenceDDL("cus:mySchema", "mySequence", "XtkNewId")
The XtkWorkflowLog schema could overuse the XtkNewID sequence. From Campaign Classic 18.4, the schema XtkWorkflowLog will use a new dedicated sequence XtkWorkflowLogId instead of XtkNewId.
The switch will be done automatically as upgrading to Campaign Classic 18.4 for already existing instances. For new 18.4 instances, the XtkWorkflowLogId sequence will be used by default.
The following schemas could overuse the XtkNewID sequence. From Campaign Classic 19.1, these schemas will use a new dedicated sequence that will be automatically created during the upgrade instead of XtkNewId.