Index: sql/transaction.cc |
=================================================================== |
--- sql/transaction.cc (revision 259649) |
+++ sql/transaction.cc (working copy) |
@@ -20,30 +20,21 @@ |
} |
bool Transaction::Begin() { |
- if (is_open_) { |
- NOTREACHED() << "Beginning a transaction twice!"; |
- return false; |
- } |
+ DCHECK(!is_open_) << "Beginning a transaction twice!"; |
Scott Hess - ex-Googler
2014/03/31 18:09:08
These changes may cause actual incorrect changes i
Peter Kasting
2014/03/31 19:53:56
We have to make _some_ change, because the old cod
|
is_open_ = connection_->BeginTransaction(); |
return is_open_; |
} |
void Transaction::Rollback() { |
- if (!is_open_) { |
- NOTREACHED() << "Attempting to roll back a nonexistent transaction. " |
- << "Did you remember to call Begin() and check its return?"; |
- return; |
- } |
+ DCHECK(is_open_) << "Attempting to roll back a nonexistent transaction. " |
+ << "Did you remember to call Begin() and check its return?"; |
is_open_ = false; |
connection_->RollbackTransaction(); |
} |
bool Transaction::Commit() { |
- if (!is_open_) { |
- NOTREACHED() << "Attempting to commit a nonexistent transaction. " |
- << "Did you remember to call Begin() and check its return?"; |
- return false; |
- } |
+ DCHECK(is_open_) << "Attempting to commit a nonexistent transaction. " |
+ << "Did you remember to call Begin() and check its return?"; |
is_open_ = false; |
return connection_->CommitTransaction(); |
} |