Handle database commits