Added $tries to Database::transaction