mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-13 01:41:59 -05:00
bug fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4569 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
1 parent
cb15fde937
commit
5693de8531
3 files changed
+46
-3
No files matched your search
@@ -1951,10 +1951,36 @@ pgend_trans_commit_edit (Backend * bend,
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* roll things back is sql version is newer */
|
||||
if (0 < pgendTransactionCompareVersion (be, oldtrans)) { rollback = 1; }
|
||||
|
||||
/* first, see if someone else has already deleted this transaction */
|
||||
if (-1 < pgendTransactionGetDeletedVersion (be, oldtrans)) { rollback ++; }
|
||||
else
|
||||
if (0 < pgendTransactionCompareVersion (be, oldtrans)) { rollback ++; }
|
||||
if (-1 < pgendTransactionGetDeletedVersion (be, oldtrans))
|
||||
{
|
||||
if (rollback)
|
||||
{
|
||||
/* Although this situation should never happen, we'll try
|
||||
* to gracefully handle it anyway, because otherwuise the
|
||||
* transaction becomes un-modifiable, undeleteable.
|
||||
* (This situation might occur with the right combo of bugs
|
||||
* and crashes. We've fixed the bugs, but ...
|
||||
*/
|
||||
char buf[80];
|
||||
gnc_timespec_to_iso8601_buff (xaccTransRetDatePostedTS (trans), buf);
|
||||
PERR ("The impossible has happened, and thats not good!\n"
|
||||
"\tThe SQL database contains an active transaction that\n"
|
||||
"\talso appears in the audit trail as deleted !!\n"
|
||||
"\tWill try to delete transaction for good\n"
|
||||
"\ttransaction is '%s' %s\n",
|
||||
xaccTransGetDescription (trans), buf);
|
||||
rollback = 0;
|
||||
trans->do_free = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
rollback = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rollback) {
|
||||
|
||||
@@ -360,6 +360,8 @@ pgendAccountGetCheckpoint (PGBackend *be, Checkpoint *chk)
|
||||
p = stpcpy (p, "' ORDER BY date_start DESC LIMIT 1;");
|
||||
SEND_QUERY (be,be->buff, );
|
||||
|
||||
/* provide default value, in case there are no checkpoints */
|
||||
chk->date_start = gnc_iso8601_to_timespec_local (CK_EARLIEST_DATE);
|
||||
pgendGetResults (be, get_checkpoint_date_cb, chk);
|
||||
|
||||
LEAVE("be=%p", be);
|
||||
|
||||
@@ -155,6 +155,21 @@ Prices need to have version numbers added.
|
||||
*/
|
||||
|
||||
|
||||
Audit Trails
|
||||
------------
|
||||
The backend keeps an audit trail of created, modified and deleted
|
||||
transactions. These are stored in s set of tables inheriting from
|
||||
the gncAuditTrail table. Identified are the date of modification,
|
||||
the the session id, and the type of change.
|
||||
|
||||
There is currently no support within the GUI to view the audit trails,
|
||||
nor is there any way to rollback to some previous state based on this
|
||||
trail.
|
||||
|
||||
The audit trails are used internally to resolve certain multi-user
|
||||
editing conflicts, for example, when one user attempts to edit a
|
||||
transaction that has been deleteed by another.
|
||||
|
||||
|
||||
Balances
|
||||
--------
|
||||
|
||||
Reference in new issue
Block a user