Block insert bean

Use the block insert bean to insert multiple items into the FTM database in a single request.

The payload class name for the block insert bean is com.ibm.paydir.ima.txacc.app.bridge.payment.BlockInsertBean.

The block insert bean collects one or more transaction insert beans that are to be applied at once at a specified position in the balance order of the batch (ICL). By default, the block insert bean inserts the transaction at the end of the balance order of the batch (ICL). If an insert after payment ID is specified, the block of transactions is placed between the given payment ID and the one immediately following it in the balance order of the current batch (ICL).
Note: Do not to reuse any transaction insert bean instances when adding them to the block insert bean because it could corrupt the previously added beans. Always create a new instance of a transaction insert bean, apply the requisite settings, and add it to the block insert bean.

When queried, the block insert bean returns ACTION_BLOCK_INSERT as its action code. Querying it for the payment ID returns the insert after payment ID. This ID is zero (0) when one is not specified. Both of the payment ID methods (for example, setPaymentId and setInsertAfter) affect the insert after payment ID value.

The caller can use the mutator methods that are shown in the following table to configure the block insert bean.
Table 1. ACTION_BLOCK_INSERT request
Method name Takes data type Description
setInsertAfter PaymentId/Long Specifies that the block of transactions be inserted after a specific transaction in the batch (ICL).
setPaymentId PaymentId/Long Behaves the same as the setInsertAfter mutator method.
add PaymentInsertBean Adds the specified transaction insert bean to the list of insertions.
Call the add method multiple times to add several transaction insert beans to the block of inserts. The inserts are placed in the batch (ICL) in the same balance order as they are added to the block insert bean. The block insert bean is useful for collecting a large set of inserts into a single message that the Transaction Server processes at once. It can also be used for inserting a single transaction at a position other that the end of the balance order of the batch (ICL).
Note: If an insert after payment ID is specified, the inserted transactions are evenly distributed between the existing transactions as found in the batch (ICL). Each transaction can be inserted individually in its own block insert. The insertion order has side effects depending on the method used.
For example, consider the insertion of three transactions, A, B, and C, after a transaction, X, which is currently at balance order 171.00. In the example, let transaction Y be the transaction immediately following transaction X and have its balance order at 172.00. Placing the transactions in a single block insert using the insert after transaction specified as transaction X, the insertion order in the following table results.
Table 2. Balance order - Single block insert
Payment Balance order
X 171.0000
A 171.2500
B 171.5000
C 171.7500
Y 172.0000
However, if the insertions are specified in three separate block insert requests, each specifying transaction X as the insert after point, then only the first insert would go between transaction X and Y while the subsequent inserts would go between X and the previously inserted transaction. This reverses the insertion order as shown in the following table.
Table 3. Balance order - Separate block insert
Payment Balance order
X 171.0000
C 171.1250
B 171.2500
A 171.5000
Y 172.0000
It is important to:
  • note the balance ordering that results from how the block insert beans are used.
  • verify whether the resulting balance order of the batch (ICL) conforms to all of the requirements.