You should be careful about ending SQL programs with uncommitted work. When a program ends with uncommitted work, the connection to the relational database remains active.
However, in some cases involving programs running in system-named activation groups, the system performs an automatic commit operation when the program ends.
This behavior differs from that of other systems because in the i5/OS™ operating system, COMMITs and ROLLBACKs can be used as commands from the command line or in a CL program. However, the preceding scenario can lead to unexpected results in the next SQL program run, unless you plan for the situation. For example, if you run Interactive SQL next (STRSQL command), the interactive session starts up in the state of being connected to the previous application server (AS) with uncommitted work. As another example, if following the preceding scenario, you start a second SQL program that does an implicit connection, an attempt is made to find and run a package for it on the AS that was last used. This might not be the AS that you intended. To avoid these surprises always commit or rollback the last unit of work before ending any application program.