diff options
Diffstat (limited to 'src/backend/access/transam/xact.c')
-rw-r--r-- | src/backend/access/transam/xact.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 8453d8688c2..6884e635904 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.37 1999/05/31 22:53:59 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.38 1999/06/03 04:41:41 vadim Exp $ * * NOTES * Transaction aborts can now occur two ways: @@ -646,6 +646,18 @@ RecordTransactionCommit() FlushBufferPool(!TransactionFlushEnabled()); if (leak) ResetBufferPool(); + + /* + * Let others know about no transaction in progress. + * Note that this must be done _before_ releasing locks + * we hold or bad (too high) XmaxRecent value might be + * used by vacuum. + */ + if (MyProc != (PROC *) NULL) + { + MyProc->xid = InvalidTransactionId; + MyProc->xmin = InvalidTransactionId; + } } @@ -884,13 +896,6 @@ StartTransaction() */ s->state = TRANS_INPROGRESS; - /* - * Let others to know about current transaction is in progress - vadim - * 11/26/96 - */ - if (MyProc != (PROC *) NULL) - MyProc->xid = s->transactionIdData; - } /* --------------- @@ -958,15 +963,6 @@ CommitTransaction() */ s->state = TRANS_DEFAULT; - /* - * Let others to know about no transaction in progress - vadim - * 11/26/96 - */ - if (MyProc != (PROC *) NULL) - { - MyProc->xid = InvalidTransactionId; - MyProc->xmin = InvalidTransactionId; - } } /* -------------------------------- |