Using a custom database transaction