This Technote describes in ACC:
- how works the feature "Sequence auto-generation"
- how works the new API GenCreateOrUpdateSchemaSequenceDDL
- the change of sequence use for some OOB schemas
Actually, in ACC, schema ID values could be automatically generated 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. In case of absence of pkSequence, by default, ACC uses OOB XtkNewId sequence.
To sum up :
The main purpose of this feature is to avoid, as much as possible, to use XtkNewId sequence, especially for custom schemas and for some OOB schemas (XtkWorkflowLog, etc.). Instead, we will generate dedicated sequences for them.
* custom autopk schema: a schema not having OOB namespace (i.e. nl, nms, xtk, crm or ncm), with autopk="true" and without specified pkSequence
** if the auto-generated sequence name has more than 30 characters, we will moderate the part <nameSpace><schemaName> using CRC32
This feature is implemented thanks to introducing a new API, which 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, we call this API 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 ACC 18.4 release, the schema XtkWorkflowLog will use a new dedicated sequence XtkWorkflowLogId instead of XtkNewId. The switch will be done automatically at build upgrade to ACC18.4 for already existing instances. For new 18.4 instances, the XtkWorkflowLogId sequence will be used by default.
Some other schema that could over consumed id will be switch to a dedicated sequence in next releases.