Skip to content

Instantly share code, notes, and snippets.

@vtkstef
Created June 12, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtkstef/666f9fd6f4f0ae8fd653 to your computer and use it in GitHub Desktop.
Save vtkstef/666f9fd6f4f0ae8fd653 to your computer and use it in GitHub Desktop.
separate fragment batches
public long run(int orderid, int count, double billing_amount, String message) throws VoltAbortException {
VoltTable[] queryresults;
for (int i=0; i < count; i++)
{
voltQueueSQL(InsertOrderItemExport, orderid * 100 + i, orderid, "ProductID", message, billing_amount, billing_amount);
}
voltQueueSQL(InsertOrderExport, orderid, "SALES_CHANNEL", "STATUS123456", "Rs", billing_amount, 1, message);
queryresults = voltExecuteSQL();
for (int i=0; i < count; i++)
{
voltQueueSQL(InsertOrderItem, orderid * 100 + i, orderid, "ProductID", message, billing_amount, billing_amount);
}
voltQueueSQL(InsertOrder, orderid, "SALES_CHANNEL", "STATUS123456", "Rs", billing_amount, 1, message);
queryresults = voltExecuteSQL(true);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment