⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transactiontableentry.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		this.update = false;		transactionStatus = 0;			}	void unsetRecoveryStatus()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot change a clone");        // RESOLVE (mikem) - this is kind of ugly. move to a better place?        firstLog = null;		this.recovery = false;	}	void prepareTransaction()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot change a clone");		transactionStatus |= Xact.END_PREPARED;	}    /**************************************************************************     * get instance variables     **************************************************************************     */	TransactionId getXid()	{		if (SanityManager.DEBUG)		{			SanityManager.ASSERT(xid != null, "TTE with null xid");			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		}		return xid;	}	public final GlobalTransactionId getGid()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		if (gid != null)			return gid;		if (myxact != null)			return myxact.getGlobalId();		return null;	}	LogInstant getFirstLog()	{		if (SanityManager.DEBUG)		{			SanityManager.ASSERT(!isClone, "cannot call method with a clone");			if (recovery)            {				SanityManager.ASSERT(                    firstLog != null,                     "a recovery transaction with a null firstLog");            }			else            {				SanityManager.ASSERT(                    firstLog == null,                     "a normal transaction with a non-null firstLog" +                    "myxact.getFirstLogInstant() = " + myxact.getFirstLogInstant());            }		}		if (firstLog != null)			return firstLog;		if (myxact != null)			return myxact.getFirstLogInstant();		return null;	}	LogInstant getLastLog()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		if (lastLog != null)			return lastLog;		if (myxact != null)			return myxact.getLastLogInstant();		return null;	}	public final Xact getXact()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return myxact;	}	int getTransactionStatus()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return transactionStatus;	}	boolean isUpdate()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return update;	}	boolean isRecovery()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return recovery;	}	boolean isPrepared()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return((transactionStatus & Xact.END_PREPARED) != 0);	}	public boolean needExclusion()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(!isClone, "cannot call method with a clone");		return needExclusion;	}	/**		Methods of TransactionInfo	 */	public String getTransactionIdString()	{		if (SanityManager.DEBUG)		{			SanityManager.ASSERT(                !recovery, "trying to display recovery transaction");			SanityManager.ASSERT(myxact != null, "my xact is null");			SanityManager.ASSERT(isClone, "Should only call method on a clone");		}		TransactionId t = myxact.getIdNoCheck();		return (t == null) ? "CLOSED" : t.toString();	}	public String getGlobalTransactionIdString()	{		if (SanityManager.DEBUG)		{			SanityManager.ASSERT(                !recovery, "trying to display recovery transaction");			SanityManager.ASSERT(myxact != null, "my xact is null");			SanityManager.ASSERT(isClone, "Should only call method on a clone");		}		GlobalTransactionId gid = myxact.getGlobalId();		return (gid == null) ? null : gid.toString();	}	public String getUsernameString()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");		getlcc();		return (lcc == null) ? null : lcc.getAuthorizationId();	}	public String getTransactionTypeString()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");        if (myxact == null)            return null;        else if (myxact.getTransName() != null)            return myxact.getTransName();        else            return myxact.getContextId();	}	public String getTransactionStatusString()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");		return (myxact == null) ? null : myxact.getState();	}	public String getStatementTextString()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");		getlcc();		if (lcc != null)		{			StatementContext sc = lcc.getStatementContext();			if (sc != null)				return sc.getStatementText() ;		}		return null;	}	public String getFirstLogInstantString()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");		LogInstant logInstant =             (myxact == null) ? null : myxact.getFirstLogInstant();		return (logInstant == null) ? null : logInstant.toString();	}			private void getlcc()	{		if (SanityManager.DEBUG)			SanityManager.ASSERT(isClone, "Should only call method on a clone");		if (lcc == null && myxact != null && myxact.xc != null)		{			XactContext xc = myxact.xc;			lcc = (LanguageConnectionContext)				xc.getContextManager().getContext(                    LanguageConnectionContext.CONTEXT_ID);		}	}	/**		Cloneable	 */	protected Object clone()	{		try 		{			Object c = super.clone();			((TransactionTableEntry)c).isClone = true;			return c;		}		catch (CloneNotSupportedException e) 		{			// this should not happen, we are cloneable			if (SanityManager.DEBUG)             {				SanityManager.THROWASSERT(                    "TransactionTableEntry cloneable but throws CloneNotSupportedException " + e);			}			return null;		}					}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -