Monday, March 31, 2008

Performance improvement in JDE using Buffered Insertion

What is a Buffered Insertion (BI)?
Buffer is an area on storage device, which holds data temporarily. Buffered Insertion is a concept to improve the performance of JD Edwards Applications/UBEs that preform bulk insert operations. when Buffered Insertion is enabled, the data will be stored in buffer until the data is flushed(commited) to the table.

How to activate Buffered Insertion(BI) in Business Functions (BSFN)?
Call JDB_SetRequestOption() with option JDB_REQUEST_OPTION_BUFFERED_INSERTS at the beginning of the process, to turn on BI's. This cause subsequent calls to JDB_InsertTable () to write to a buffer rather than the database.
When are the records in the buffer flushed (commited) to DataBase?
The records in the buffer will be flushed to the actual database up on, one of the following cases:
  • When the buffer reaches to maximum size (64k) (or) buffer grows to a size of 100 rows, which ever is earlier.
  • When JDB_CloseTable () api is called.
  • or JDB_CommitUser() is called.

Where we can't use Buffer Insertions?
Wrong usage of buffered Insertion will affect the performance and lead the application to behave strangely.So it should not be used in the following cases:

  • If the table contain BLOB (Binary Large Object) data items.
  • If the BSFN logic too many calls to JDB_CloseTable() api for few records.
  • Most importantly the recently inserted record(s) should not be fetched for further processing, before making sure that the record is flushed to the table.After all one should remember that the record is inserted to buffer and not the database.
  • When the view contain more than one table.

No comments: