Database operations | Web 2.0 considerations
12.1.6 Command execution
Some common coding practices for when working with WebSphere Commerce commands are:
- Batch price retrieval calls.
Looking up a price via one of the contract price retrieval task commands travels a lengthy code path. If your code has to look up several prices, it is faster to specify all of them in a single call rather than make a separate call for each price retrieval.
- Re-use command instances.
Task and controller command instances are retrieved from the CommandFactory. They can be executed more than once in the same transaction. Call the reset method to re-initialize a command for re-execution.