We all must have done scripting n number of times and scripting in Siebel inevitably involves querying database to fetch records and usually we write the statement buscomp.ExecuteQuery()

What we forget here is that ExecuteQuery has an argument called cursor mode which is optional and we all forget to supply it. ExecuteQuery method can have 2 types of cursor modes.

  • ForwardOnly
  • ForwardBackward

ForwardBackward: is the default cursor mode, which means if we don’t supply any value (which is our usual practice) it will be assumed as ForwardBackward. In this mode we can process records from first to last or last to first which in turn means that you can use NextRecord and PreviousRecord methods without any problem.

ForwardOnly mode means that records can only be processed from first to last and focus cannot return on a record.

What is important to know here is that these modes can have impact on performance of application.

Until and unless you have an explicit requirement to use pervious records or to use FirstRecord time and again without re-querying specify the mode as ForwardOnly.

In my experience till now I haven’t faced an requirement which involves the use of previous record and till sometime back I never supplied this argument which means that what I coded till now is affecting the performance of the application.

Just a couple of thing that you need to keep in mind while using ForwardOnly mode are

  • Make sure you code is not using PreviousRecord method.
  • Make sure you re-query again if you are using FirstRecord method after the first ExecuteQuery in code.
  • Do not use ForwardOnly mode on UI BC which means on when you do this.ExecuteQuery.

Reason for performance impact:

When we use cursor mode as ForwardBackward Siebel creates a bigger buffer to provide for provision of traversing pervious records which in turn means more memory usage and hence slowing the application down.

So the moral of the post is:

When using ExecuteQuery always supply the cursor mode depending on your requirement.

OkAvarageGoodVery GoodExcellent (No Ratings Yet)
Loading ... Loading ...

Related Posts