Performing a Bulk Extract

A bulk extract refers to a mass sending of events describing the current state of object instances in the database through the event stream without waiting for an update on these instances.

The most common reason for this is to fill a data sink that sits downstream in your event streaming pipeline.

Use the updateObjectAndSlobOrBlobEditions method of the Object class to perform a one‑time bulk extract to push the current state of a large number of object instances through the event stream without waiting for an updating transaction for these instances.

Before performing a bulk extract, make sure that it is necessary for your use case and that you have considered some of the performance concerns listed later in this section.

Before you attempt any bulk extract operations, ensure that the JadeChangeCaptureApp application is running and configured correctly and that the classes you want to extract are specified in the Change Capture Specification file. For details, see "Change Capture Specification File", elsewhere in this document.

After configuring the Change Capture Specification file, write an appropriate script to perform the bulk extract and run it. The following is an example of a script to perform the bulk extract with comments providing additional context.

bulkExtractClass();
vars
    instance: Object;
    instanceArray: ObjectArray;
    maximumInstances: Integer64;
begin
    //Collect all the instances of this class
    create instanceArray transient;
    /*Set the maximum number of instances to extract. Be careful, Max_Integer 
    (max value allowed for this method) is used for demonstration, but make 
    sure you know how many you're about to extract before you start*/
    maximumInstances := Max_Integer;
    C1.allInstances(instanceArray, maximumInstances, false); /*Last parameter 
    indicates we don't want instances that are subclasses*/
    beginTransaction;
    foreach instance in instanceArray do
        if app.isValidObject(instance) then /*Make sure the instance hasn't been
       deleted by a concurrent transaction*/
            instance.updateObjectAndSlobOrBlobEditions(instance);  
            //Here, any object will do as a receiver. Only the parameter matters
      endif;
    endforeach;
    commitTransaction;
epilog
    delete instanceArray;
end;

Note the comments in the previous method example, specifically:

2025.0.01 and higher