Skip Headers

# Configuring the Same Sequence for Multiple Descriptors

Previous

Next

As Example: Configuring a Sequence for Multiple Descriptors shows, you can associate the same sequence with more than one descriptor. In this example, both the `Employee` descriptor and `Phone` descriptor use the same `NativeSequence`. Having descriptors share the same sequence can improve pre-allocation performance. For more information on pre-allocation, see "Sequencing and Preallocation Size".

Configuring a Sequence for Multiple Descriptors

    empDescriptor.setSequenceNumberFieldName("EMP_ID"); // primary key field
    empDescriptor.setSequenceNumberName("NAT_SEQ");
    phoneDescriptor.setSequenceNumberFieldName("PHONE_ID"); // primary key field
    phoneDescriptor.setSequenceNumberName("NAT_SEQ");