*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.142 2003/03/10 22:28:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.143 2003/03/14 22:40:31 momjian Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
0, /* scan command id */
0x0, /* start time */
TRANS_DEFAULT, /* transaction state */
- TBLOCK_DEFAULT /* transaction block state of client queries */
+ TBLOCK_DEFAULT /* transaction block state from
+ the client perspective */
};
TransactionState CurrentTransactionState = &CurrentTransactionStateData;
#endif
-/* --------------------------------
+/*
* IsTransactionState
*
* This returns true if we are currently running a query
* within an executing transaction.
- * --------------------------------
*/
bool
IsTransactionState(void)
return false;
}
-/* --------------------------------
+/*
* IsAbortedTransactionBlockState
*
* This returns true if we are currently running a query
* within an aborted transaction block.
- * --------------------------------
*/
bool
IsAbortedTransactionBlockState(void)
}
-/* --------------------------------
+/*
* GetCurrentTransactionId
- * --------------------------------
*/
TransactionId
GetCurrentTransactionId(void)
}
-/* --------------------------------
+/*
* GetCurrentCommandId
- * --------------------------------
*/
CommandId
GetCurrentCommandId(void)
}
-/* --------------------------------
+/*
* GetCurrentTransactionStartTime
- * --------------------------------
*/
AbsoluteTime
GetCurrentTransactionStartTime(void)
}
-/* --------------------------------
+/*
* GetCurrentTransactionStartTimeUsec
- * --------------------------------
*/
AbsoluteTime
GetCurrentTransactionStartTimeUsec(int *msec)
}
-/* --------------------------------
+/*
* TransactionIdIsCurrentTransactionId
*
* During bootstrap, we cheat and say "it's not my transaction ID" even though
* it is. Along with transam.c's cheat to say that the bootstrap XID is
* already committed, this causes the tqual.c routines to see previously
* inserted tuples as committed, which is what we need during bootstrap.
- * --------------------------------
*/
bool
TransactionIdIsCurrentTransactionId(TransactionId xid)
}
-/* --------------------------------
+/*
* CommandIdIsCurrentCommandId
- * --------------------------------
*/
bool
CommandIdIsCurrentCommandId(CommandId cid)
}
-/* --------------------------------
+/*
* CommandCounterIncrement
- * --------------------------------
*/
void
CommandCounterIncrement(void)
* ----------------------------------------------------------------
*/
-/* --------------------------------
+/*
* AtStart_Cache
- * --------------------------------
*/
static void
AtStart_Cache(void)
AcceptInvalidationMessages();
}
-/* --------------------------------
+/*
* AtStart_Locks
- * --------------------------------
*/
static void
AtStart_Locks(void)
*/
}
-/* --------------------------------
+/*
* AtStart_Memory
- * --------------------------------
*/
static void
AtStart_Memory(void)
}
-/* --------------------------------
+/*
* AtCommit_Cache
- * --------------------------------
*/
static void
AtCommit_Cache(void)
AtEOXactInvalidationMessages(true);
}
-/* --------------------------------
+/*
* AtCommit_LocalCache
- * --------------------------------
*/
static void
AtCommit_LocalCache(void)
CommandEndInvalidationMessages(true);
}
-/* --------------------------------
+/*
* AtCommit_Locks
- * --------------------------------
*/
static void
AtCommit_Locks(void)
ProcReleaseLocks(true);
}
-/* --------------------------------
+/*
* AtCommit_Memory
- * --------------------------------
*/
static void
AtCommit_Memory(void)
MyProc->logRec.xrecoff = 0;
}
-/* --------------------------------
+/*
* AtAbort_Cache
- * --------------------------------
*/
static void
AtAbort_Cache(void)
AtEOXactInvalidationMessages(false);
}
-/* --------------------------------
+/*
* AtAbort_Locks
- * --------------------------------
*/
static void
AtAbort_Locks(void)
}
-/* --------------------------------
+/*
* AtAbort_Memory
- * --------------------------------
*/
static void
AtAbort_Memory(void)
* ----------------------------------------------------------------
*/
-/* --------------------------------
+/*
* AtCleanup_Memory
- * --------------------------------
*/
static void
AtCleanup_Memory(void)
* ----------------------------------------------------------------
*/
-/* --------------------------------
+/*
* StartTransaction
- * --------------------------------
*/
static void
StartTransaction(void)
}
-/* --------------------------------
+/*
* CommitTransaction
- * --------------------------------
*/
static void
CommitTransaction(void)
RESUME_INTERRUPTS();
}
-/* --------------------------------
+/*
* AbortTransaction
- * --------------------------------
*/
static void
AbortTransaction(void)
RESUME_INTERRUPTS();
}
-/* --------------------------------
+/*
* CleanupTransaction
- * --------------------------------
*/
static void
CleanupTransaction(void)
s->state = TRANS_DEFAULT;
}
-/* --------------------------------
+/*
* StartTransactionCommand
*
* preventChain, if true, forces autocommit behavior at the next
* CommitTransactionCommand call.
- * --------------------------------
*/
void
StartTransactionCommand(bool preventChain)
MemoryContextSwitchTo(TransactionCommandContext);
}
-/* --------------------------------
+/*
* CommitTransactionCommand
*
* forceCommit = true forces autocommit behavior even when autocommit is off.
- * --------------------------------
*/
void
CommitTransactionCommand(bool forceCommit)
}
}
-/* --------------------------------
+/*
* AbortCurrentTransaction
- * --------------------------------
*/
void
AbortCurrentTransaction(void)
}
}
-/* --------------------------------
+/*
* PreventTransactionChain
*
* This routine is to be called by statements that must not run inside
* stmtNode: pointer to parameter block for statement; this is used in
* a very klugy way to determine whether we are inside a function.
* stmtType: statement type name for error messages.
- * --------------------------------
*/
void
PreventTransactionChain(void *stmtNode, const char *stmtType)
}
}
-/* --------------------------------
+/*
* RequireTransactionChain
*
* This routine is to be called by statements that must run inside
* stmtNode: pointer to parameter block for statement; this is used in
* a very klugy way to determine whether we are inside a function.
* stmtType: statement type name for error messages.
- * --------------------------------
*/
void
RequireTransactionChain(void *stmtNode, const char *stmtType)
* transaction block support
* ----------------------------------------------------------------
*/
-/* --------------------------------
+/*
* BeginTransactionBlock
- * --------------------------------
*/
void
BeginTransactionBlock(void)
s->blockState = TBLOCK_INPROGRESS;
}
-/* --------------------------------
+/*
* EndTransactionBlock
- * --------------------------------
*/
void
EndTransactionBlock(void)
s->blockState = TBLOCK_ENDABORT;
}
-/* --------------------------------
+/*
* AbortTransactionBlock
- * --------------------------------
*/
#ifdef NOT_USED
static void
}
#endif
-/* --------------------------------
+/*
* UserAbortTransactionBlock
- * --------------------------------
*/
void
UserAbortTransactionBlock(void)
s->blockState = TBLOCK_ENDABORT;
}
-/* --------------------------------
+/*
* AbortOutOfAnyTransaction
*
* This routine is provided for error recovery purposes. It aborts any
* active transaction or transaction block, leaving the system in a known
* idle state.
- * --------------------------------
*/
void
AbortOutOfAnyTransaction(void)