Using ServiceLayer Direct
Distributed ImpEx allows you to use ServiceLayer Direct.
Enabling ServiceLayer Direct for All Imports
You can enable ServiceLayer Direct in the distributed mode for the whole process of importing data, for all imports. To enable SLD (direct persistence) and the distributed mode, configure an ImportConfig object as follows:
final ImportConfig config = new ImportConfig(); config.setDistributedImpexEnabled(true); //enables distributed impex config.setSldForData(true); //enables direct persistence mode
You can enable SLD in Backoffice or Administration Console. The Backoffice ImpEx import wizard contains the Distributed Mode option. After you choose it, the Direct persistence option becomes available. Note that when you choose Distributed Mode, some classical ImpEx input fields become unavailable (as not relevant for the distributed mode). You can find the same options in Administration Console.
Switching from Legacy Mode to ServiceLayer Direct for One Header
You can have the whole distributed import process working in the legacy mode and at the same time force it to switch to the direct persistence mode for a selected batch, or header. To use that feature, set the sld.enabled modifier in a header of a chosen import file to true:
INSERT_UPDATE Title[sld.enabled=true];code[unique=true] ;foo_sld_forced_by_header ;bar_sld_forced_by_headerSetting the modifier to sld.enabled=true means that both titles are to be imported using the SLD mode, even if the global switch, or the flag in ImportConfig is set to the legacy mode. Compare with the persistence.legacy.mode flag mentioned above.