Sunday, April 27, 2008

Application Engine Commits

At my work, I realized that while application engines were being created, people did not know exactly how commits work in application engine.

I therefore set out to undertand application engine commits better. Here is what I have figured out so far:


If you create a new App. Engine program and do nothing for handling commits, the ae is automatically configured to commit after the application engine completes. This means that if the program aborts, everything is rolled back. It also means that there is additional burden on the database to keep track of uncommitted data.

However, there are settings at the section and step level that can be used to commit at specific points in time in the program.

An understanding of the commits is helpful.


1. At Section Level :
1. Turn on commit after step to get AE to commit after every step in that section.
2. Commit even n rows: Foe sections that contain do while, do until and do select, set the
commit frequency to commit after every n rows. The commit fired here is in addition to
commits fired in the loop.

Restriction: For Action of Do Select of type select/fetch where the restart is enabled, the
commits within the loop is ignored.

2. At Step
1. Default: based on the setting at the section.
2. After Step : To override the setting at section and commit after the step completes.
3. Later: To override the setting at section and not commit after step. ( when at section, you
have defined for commit after step. )

No comments: