Search in sources :

Example 1 with IdBlock

use of org.camunda.bpm.engine.impl.db.IdBlock in project camunda-bpm-platform by camunda.

the class GetNextIdBlockCmd method execute.

public IdBlock execute(CommandContext commandContext) {
    PropertyEntity property = commandContext.getPropertyManager().findPropertyById("next.dbid");
    long oldValue = Long.parseLong(property.getValue());
    long newValue = oldValue + idBlockSize;
    property.setValue(Long.toString(newValue));
    return new IdBlock(oldValue, newValue - 1);
}
Also used : IdBlock(org.camunda.bpm.engine.impl.db.IdBlock) PropertyEntity(org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity)

Aggregations

IdBlock (org.camunda.bpm.engine.impl.db.IdBlock)1 PropertyEntity (org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity)1