Unifying memory and database transactions