OSCommerce Product Manager

OSCommerce Product Manager for Windows

FS#340 - Batch operations.

Attached to Project: OSCommerce Product Manager
Opened by Mario A. Valdez-Ramirez (mvaldez) - Tuesday, 15 May 2007, 02:46 GMT-5
Last edited by Mario A. Valdez-Ramirez (mvaldez) - Tuesday, 15 May 2007, 02:46 GMT-5
Task Type New feature
Category Backend / Core
Status Assigned
Assigned To Mario A. Valdez-Ramirez (mvaldez)
Operating System All
Severity Medium
Priority Urgent
Reported Version any
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


The OSCPMWin application should send several operations in a batch, saving time and reducing bandwith usage.

Currently each SQL operation start a new HTTP connection, which may be expensive for some users with low bandwidth or high latency.

The application could batch several operations which can be considered atomic (for example, all SQL queries to update the DB tables for a given product update) and send them in the same HTTP query.

The server-side script should separate each query, process it, and create the resulting record set or recordsets.

Pending to design.
This task depends upon

Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 07 August 2010, 17:26 GMT-5
As we are solving Bug #168, we can implement this in the following manner:

Send the operation as usual (field Op), then send an array of operands and operators. The server-side PHP script can convert fields named as xxxx[y] to arrays. So for example, for the PRODUCT_DELETE operation, the operand for a single deletion would be the ProductID. For a batch of deletions (for example, when the user select several products from the product list and then request its deletion) the operands would be a vector with ProductIDs. Then the script would just iterate on them deleting each one. For this operation there would be a single HTTP connection to the server; currently, for 10 product deletions, for example, it would require at least 40 connections and up to 110 connections (one for each SQL query).

For other operations, like searches or new products, the array could be set as (field, data) pairs.

Comment by Mario A. Valdez-Ramirez (mvaldez) - Saturday, 07 August 2010, 17:28 GMT-5
We need a way to return the status of each operation for operations that don't return a recordset.

Operations that return a recordset maybe cannot be batched.