$stmt = $pdo->prepare("SELECT somedata FROM mytable FOR UPDATE");
$pdo->beginTransaction();
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ( $row == FALSE ) {
$pdo->rollBack();
} else {
....run some code and then commit
Is the rollBack necessary because it is only called when there isn't a row locked due to no row being returned? Are any resources wasted by selecting for update and never rolling back or committing in the case when nothing is actually selected?