📄 transaction.java
字号:
*/ public ContainerHandle openContainer(ContainerKey containerId, int mode) throws StandardException; /** Open a container, with the defined locking policy, otherwise as openContainer(int containerId, boolean forUpdate). <P> Calls locking.lockContainer(this, returnValue, forUpdate) to lock the container. Note that if NOWAIT has been specified lock will be requested with no wait time, and if lock is not granted a SQLState.LOCK_TIMEOUT exception will be thrown. @param locking The lock policy to use, if null then then a no locking policy will be used. @return a valid ContainerHandle or null if the container does not exist. @exception StandardException Standard cloudscape exception policy */ public ContainerHandle openContainer( ContainerKey containerId, LockingPolicy locking, int mode) throws StandardException; /** Add a new container to the segment. The new container initially has one page, page Container.FIRST_PAGE_NUMBER. <BR> If pageSize is equal to ContainerHandle.DEFAULT_PAGESIZE or invalid then a default page size will be picked. <BR> SpareSpace indicates that percent (0% - 100%) of page space that will be attempted to be reserved for updates. E.g. with a value of 20 a page that would normally hold 40 rows will be limited to 32 rows, actual calculation for the threshold where no more inserts are all accepted is up to the implementation. Whatever the value of spaceSpace an empty page will always accept at least one insert. If spare space is equal to ContainerHandle.DEFAULT_PAGESIZE or invalid then a default value will be used. <P><B>Synchronisation</B> <P> The new container is exclusivly locked by this transaction until it commits. @param segmentId segment to create the container in. @param containerId If not equal to 0 then this container id will be used to create the container, else if set to 0 then the raw store will assign a number. @param mode mode description in @see ContainerHandle. This mode is only effective for the duration of the addContainer call and not stored persistently for the lifetime of the container. @param tableProperties Implementation-specific properties of the conglomerate. @return a container identifer that can be used in openContainer() This id is only valid within this RawStoreFactory. Returns a negative number if a container could not be allocated. @exception StandardException Standard Cloudscape error policy */ public long addContainer( long segmentId, long containerId, int mode, Properties tableProperties, int temporaryFlag) throws StandardException; /** Drop a container. <P><B>Synchronisation</B> <P> This call will mark the container as dropped and then obtain an CX lock on the container. Once a container has been marked as dropped it cannot be retrieved by any openContainer() call. <P> Once the exclusive lock has been obtained the container is removed and all its pages deallocated. The container will be fully removed at the commit time of the transaction. @exception StandardException Standard Cloudscape error policy */ public void dropContainer(ContainerKey containerId) throws StandardException; /** Add a new stream container to the segment and load the stream container. This stream container doesn't not have locks, and do not log. It does not have the concept of a page. It is used by the external sort only. <P><B>Synchronisation</B> <P> This call will mark the container as dropped and then obtain an CX lock on the container. Once a container has been marked as dropped it cannot be retrieved by any openContainer() call. <P> Once the exclusive lock has been obtained the container is removed and all its pages deallocated. The container will be fully removed at the commit time of the transaction. @exception StandardException Standard Cloudscape error policy */ public long addAndLoadStreamContainer( long segmentId, Properties tableProperties, RowSource rowSource) throws StandardException; /** Open a stream container. @return a valid StreamContainerHandle or null if the container does not exist. @exception StandardException Standard cloudscape exception policy */ public StreamContainerHandle openStreamContainer( long segmentId, long containerId, boolean hold) throws StandardException; /** Drop a stream container. <P><B>Synchronisation</B> <P> This call will remove the container. @exception StandardException Standard Cloudscape error policy */ public abstract void dropStreamContainer(long segmentId, long containerId) throws StandardException; /** Log an operation and then action it in the context of this transaction. The Loggable Operation is logged in the transaction log file and then its doMe method is called to perform the required change. If this transaction aborts or a rollback is performed of the current savepoint (if any) then a compensation Operation needs to be generated that will compensate for the change of this Operation. @param operation the operation that is to be applied @see Loggable @exception StandardException Standard cloudscape exception policy */ public void logAndDo(Loggable operation) throws StandardException; /** Add to the list of post commit work that may be processed after this transaction commits. If this transaction aborts, then the post commit work list will be thrown away. No post commit work will be taken out on a rollback to save point. @param work the post commit work that is added */ public void addPostCommitWork(Serviceable work); /** Add to the list of post termination work that may be processed after this transaction commits or aborts. @param work the post termination work that is added */ public void addPostTerminationWork(Serviceable work); /** * Reveals whether the transaction has ever read or written data. * * @return true If the transaction has never read or written data. **/ public boolean isIdle(); /** Reveal whether the transaction is in a pristine state, which means it hasn't done any updates since the last commit. @return true if so, false otherwise */ public boolean isPristine(); /** Get an object to handle non-transactional files. */ public FileResource getFileHandler(); /** Get cache statistics for the specified cache */ public abstract long[] getCacheStats(String cacheName); /** Reset the cache statistics for the specified cache */ public abstract void resetCacheStats(String cacheName); /** Return true if any transaction is blocked, even if not by this one. */ public boolean anyoneBlocked(); /** * Convert a local transaction to a global transaction. * <p> * Get a transaction controller with which to manipulate data within * the access manager. Tbis controller allows one to manipulate a * global XA conforming transaction. * <p> * Must only be called a previous local transaction was created and exists * in the context. Can only be called if the current transaction is in * the idle state. * <p> * The (format_id, global_id, branch_id) triplet is meant to come exactly * from a javax.transaction.xa.Xid. We don't use Xid so that the system * can be delivered on a non-1.2 vm system and not require the javax classes * in the path. * * @param format_id the format id part of the Xid - ie. Xid.getFormatId(). * @param global_id the global transaction identifier part of XID - ie. * Xid.getGlobalTransactionId(). * @param branch_id The branch qualifier of the Xid - ie. * Xid.getBranchQaulifier() * * @exception StandardException Standard exception policy. **/ void createXATransactionFromLocalTransaction( int format_id, byte[] global_id, byte[] branch_id) throws StandardException; /** * This method is called to commit the current XA global transaction. * <p> * RESOLVE - how do we map to the "right" XAExceptions. * <p> * * @return The identifier to be used to open the conglomerate later. * * @param onePhase If true, the resource manager should use a one-phase * commit protocol to commit the work done on behalf of * current xid. * * @exception StandardException Standard exception policy. **/ public void xa_commit( boolean onePhase) throws StandardException; /** * This method is called to ask the resource manager to prepare for * a transaction commit of the transaction specified in xid. * <p> * * @return A value indicating the resource manager's vote on the * the outcome of the transaction. The possible values * are: XA_RDONLY or XA_OK. If the resource manager wants * to roll back the transaction, it should do so by * throwing an appropriate XAException in the prepare * method. * * @exception StandardException Standard exception policy. **/ public int xa_prepare() throws StandardException; public static final int XA_RDONLY = 1; public static final int XA_OK = 2; /** * rollback the current global transaction. * <p> * The given transaction is roll'ed back and it's history is not * maintained in the transaction table or long term log. * <p> * * @exception StandardException Standard exception policy. **/ public void xa_rollback() throws StandardException; /** * get string ID of the actual transaction ID that will * be used when transaction is in active state. */ public String getActiveStateTxIdString();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -