Improved database transactions