> -----Original Message-----
> From: Hiroshi Inoue
> > -----Original Message-----
> > From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> > 
> > Anyway, it sounds like we agree that this is the approach to pursue.
> > Do you have time to chase down the details?
> 
> OK,I will examine a little though I'm a little busy this week.
>

Sorry,I'm so late and haven't so much time to examin the details.
I'm afraid another point now.
Woundn't this change waste XIDs in case of abort loop ?

Anyway,I examied the loop in PostgresMain()
 (;;)
 {
  ..
  StartTransactionCommand()
  ..
  pg_exec_query()
  ..
  CommitTransactionCommand()(/AbortCurrentTrabsaction())
  ..
 }

In my thoughts,the follwoing commands preceded by +?
would be added,ones preceded by -? would be removed.

StartTransactionCommand()
	TBLOCK_DEFAULT	StartTransaction()	->
	TBLOCK_BEGIN				-> TBLOCK_INPROGRESS
	TBLOCK_INPROGRES				->
	TBLOCK_END		CommitTransaction()	->
				StartTransaction()	-> TBLOCK_DEFAULT
	TBLOCK_ABORT				->
	TBLOCK_ENDABORT				->
	
CommitTransactionCommand()
	TBLOCK_DEFAULT	CommitTransaction()	->
	TBLOCK_BEGIN				-> TBLOCK_INPROGRESS
	TBLOCK_INPROGRESS	CommandCounterIncrement()	->
	TBLOCK_END		CommitTransaction()	-> TBLOCK_DEFAULT
	TBLOCK_ABORT	+? AbortTransaction()
				+? StartTransaction()	->
	TBLOCK_ENDABORT	+? AbortTransaction()	-> TBLOCK_DEFAULT

BeginTransactionBlock() ( <- BEGIN command )
	TRANS_DISABLED				->
	otherwise		-> TBLOCK_BEGIN	-> TBLOCK_INPROGRESS

UserAbortTransaction() ( <- ROLLBACK command )
	TRANS_DISABLED				->
	TBLOCK_INPROGRESS	 -? AbortTransaction()	-> TBLOCK_ENDABORT
	TBLOCK_ABORT				-> TBLOCK_ENDABORT
	otherwise		-? AbortTransaction()	-> TBLOCK_ENDABORT

EndTransactionBlock() ( <- COMMIT command )
	TRANS_DISABLED				->
	TBLOCK_INPROGRESS				-> TBLOCK_END	
	TBLOCK_ABORT				-> TBLOCK_ENDABORT
	otherwise					-> TBLOCK_ENDABORT

AbortCurrentTransaction() ( elog(ERROR/FATAL) )
	TBLOCK_DEFAULT	AbortTransaction()	->
	TBLOCK_BEGIN	AbortTransaction()
				+? StartTransaction()	-> TBLOCK_ABORT
	TBLOCK_INGRESS	AbortTransaction()
				+? StartTransaction()	-> TBLOCK_ABORT
	TBLOCK_END		AbortTransaction()	-> TBLOCK_DEFAULT
	TBLOCK_ABORT	+? AbortTransaction()
				+? StartTransaction()	->
	TBLOCK_ENDABORT	+? AbortTransaction()	-> TBLOCK_DEFAULT

AbortOutAnyTransaction() ( Async_UnlistenOnExit() )
	TRANS_DEFAULT				-> TBLOCK_DEFAULT
	otherwise		AbortTransaction()	-> TBLOCK_DEFAULT


Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

Fri, 26 May 2000 12:16:06 +0900
"Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: Orphaned locks in 7.0? 