Batch processing through REST

Hello,

I’m interested in the possibility of updating/inserting records via the REST API in batch. I read here that this used to be supported and was removed for standards compliance reasons in 6.3.

I created a Service endpoint that accepts an array of records for batch processing and it is considerably faster than processing records one at a time. Before including something like this in our product I would like to know if there is another recommendation or if the Cuba team is planning on supporting this feature in a future release.

Guidance is much appreciated.

Hi Matt,

I’m aware of a Issue that will enable this bulk mode: PL-9113.

When this will get resolved - i don’t know :wink:

But until then you can use a custom service like this:


class BatchService {

@Inject
DataManager dataManager;

public void bulkImport(Collection<Entity> entities) {
  dataManager.commit(entities)
}

}

Bye
Mario

Hi guys,

A custom service method exposed as a REST endpoint should work fine. And actually we don’t have much motivation to implement a standard endpoint for this.

Hello Mario,

I tried the dataManager.commit(entities) as you suggested, but the method does not accept a collection of an Entity.

Please let me know if i’m wrong and would be great if you would suggest an alternative for batch processing.

Regards,
Adnan