OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sql/connection.h" | 5 #include "sql/connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 Close(); | 449 Close(); |
450 return false; | 450 return false; |
451 } | 451 } |
452 | 452 |
453 return true; | 453 return true; |
454 } | 454 } |
455 | 455 |
456 void Connection::DoRollback() { | 456 void Connection::DoRollback() { |
457 Statement rollback(GetCachedStatement(SQL_FROM_HERE, "ROLLBACK")); | 457 Statement rollback(GetCachedStatement(SQL_FROM_HERE, "ROLLBACK")); |
458 rollback.Run(); | 458 rollback.Run(); |
| 459 needs_rollback_ = false; |
459 } | 460 } |
460 | 461 |
461 void Connection::StatementRefCreated(StatementRef* ref) { | 462 void Connection::StatementRefCreated(StatementRef* ref) { |
462 DCHECK(open_statements_.find(ref) == open_statements_.end()); | 463 DCHECK(open_statements_.find(ref) == open_statements_.end()); |
463 open_statements_.insert(ref); | 464 open_statements_.insert(ref); |
464 } | 465 } |
465 | 466 |
466 void Connection::StatementRefDeleted(StatementRef* ref) { | 467 void Connection::StatementRefDeleted(StatementRef* ref) { |
467 StatementRefSet::iterator i = open_statements_.find(ref); | 468 StatementRefSet::iterator i = open_statements_.find(ref); |
468 if (i == open_statements_.end()) | 469 if (i == open_statements_.end()) |
(...skipping 15 matching lines...) Expand all Loading... |
484 | 485 |
485 int Connection::OnSqliteError(int err, sql::Statement *stmt) { | 486 int Connection::OnSqliteError(int err, sql::Statement *stmt) { |
486 if (error_delegate_.get()) | 487 if (error_delegate_.get()) |
487 return error_delegate_->OnError(err, this, stmt); | 488 return error_delegate_->OnError(err, this, stmt); |
488 // The default handling is to assert on debug and to ignore on release. | 489 // The default handling is to assert on debug and to ignore on release. |
489 DLOG(FATAL) << GetErrorMessage(); | 490 DLOG(FATAL) << GetErrorMessage(); |
490 return err; | 491 return err; |
491 } | 492 } |
492 | 493 |
493 } // namespace sql | 494 } // namespace sql |
OLD | NEW |