messages.py use begin/commit for messages