Subject | Re: Confusion about CommitAction and transaction timeouts |
---|---|
Author | Stephen Boyd |
Post date | 2005-10-27T18:14:59Z |
After much time spent with the debugger here is what I have found:
CommitAction = caFetchAll
Does just what the name implies. Fetches all rows for the dataset
prior to commit. Once committed IBO is done.
CommitAction = caInvalidateCursor or caRefreshKeys
Original transaction is committed. IBO then checks to see if it
needs to refresh the keys. If refresh is needed, and it always seems
to be, then IBO starts a new transaction and fetches all the keys.
Eventually this transaction times out and the process starts all over
again. You can see it in the SQL monitor. With the settings that I
have the server is hit to refresh the keys every 6 or seven seconds.
Fetching only the keys may be more efficient than fetching entire
rows but not if IBO is refreshing the keys every few seconds all day
long whether they need it or not.
So I guess my original question becomes, is this the way IBO is
supposed to behave? If so, it seems as though you will always have a
transaction open unless you are using caClose or caFetchAll for
CommitAction. In addition, if you set the TimeoutProps to values
small enough to close automatic transactions in a timely manner you
are going to add significant additional overhead to the server as it
processes all those refresh requests.
Am I missing something obvious or am I paying a significant price to
close the automatic transactions? It would seem to be less painful
to live with a stuck OAT than to incur all this overhead.
CommitAction = caFetchAll
Does just what the name implies. Fetches all rows for the dataset
prior to commit. Once committed IBO is done.
CommitAction = caInvalidateCursor or caRefreshKeys
Original transaction is committed. IBO then checks to see if it
needs to refresh the keys. If refresh is needed, and it always seems
to be, then IBO starts a new transaction and fetches all the keys.
Eventually this transaction times out and the process starts all over
again. You can see it in the SQL monitor. With the settings that I
have the server is hit to refresh the keys every 6 or seven seconds.
Fetching only the keys may be more efficient than fetching entire
rows but not if IBO is refreshing the keys every few seconds all day
long whether they need it or not.
So I guess my original question becomes, is this the way IBO is
supposed to behave? If so, it seems as though you will always have a
transaction open unless you are using caClose or caFetchAll for
CommitAction. In addition, if you set the TimeoutProps to values
small enough to close automatic transactions in a timely manner you
are going to add significant additional overhead to the server as it
processes all those refresh requests.
Am I missing something obvious or am I paying a significant price to
close the automatic transactions? It would seem to be less painful
to live with a stuck OAT than to incur all this overhead.