The problem there is the build script runs in a database isolation level that would cause any changes made within the build script (like setting a flag) not to appear until the build script ran commit() on its transaction. The only way to expose the changed state would be to start another transaction, make your change, commit the change, and then return to your original transaction context; this gets ugly fast.