Added SQLite database transaction code