mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Bug 632166: gnc_backend_sql_sync_all: Commit only if all operations were successful; otherwise roll back.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19682 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -519,13 +519,18 @@ gnc_sql_sync_all( GncSqlBackend* be, /*@ dependent @*/ QofBook *book )
|
||||
{
|
||||
qof_object_foreach_backend( GNC_SQL_BACKEND, write_cb, be );
|
||||
}
|
||||
if ( is_ok )
|
||||
{
|
||||
(void)gnc_sql_connection_commit_transaction( be->conn );
|
||||
be->is_pristine_db = FALSE;
|
||||
|
||||
(void)gnc_sql_connection_commit_transaction( be->conn );
|
||||
be->is_pristine_db = FALSE;
|
||||
|
||||
// Mark the book as clean
|
||||
qof_book_mark_saved( book );
|
||||
|
||||
// Mark the book as clean
|
||||
qof_book_mark_saved( book );
|
||||
}
|
||||
else
|
||||
{
|
||||
gnc_sql_connection_rollback_transaction( be->conn );
|
||||
}
|
||||
LEAVE( "book=%p", book );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user