当前位置: 首页>>代码示例>>Java>>正文


Java Xid.equals方法代码示例

本文整理汇总了Java中javax.transaction.xa.Xid.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Xid.equals方法的具体用法?Java Xid.equals怎么用?Java Xid.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.transaction.xa.Xid的用法示例。


在下文中一共展示了Xid.equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateXid

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
/**
 *
 * @throws XAException if the given Xid is the not the Xid of the current
 *   transaction for this XAResource object.
 * @param xid Xid
 */
private void validateXid(Xid xid) throws XAException {

    if (xid == null) {
        throw new XAException("Null Xid");
    }

    if (this.xid == null) {
        throw new XAException(
            "There is no live transaction for this XAResource");
    }

    if (!xid.equals(this.xid)) {
        throw new XAException(
            "Given Xid is not that associated with this XAResource object");
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:JDBCXAResource.java

示例2: validateXid

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
/**
 * @throws XAException if the given Xid is the not the Xid of the
 *                     current transaction for this XAResource object.
 */
private void validateXid(Xid xid) throws XAException {

    if (xid == null) {
        throw new XAException("Null Xid");
    }

    if (this.xid == null) {
        throw new XAException(
            "There is no live transaction for this XAResource");
    }

    if (!xid.equals(this.xid)) {
        throw new XAException(
            "Given Xid is not that associated with this XAResource object");
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:JDBCXAResource.java

示例3: switchToXid

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
private synchronized void switchToXid(Xid xid) throws XAException {
    if (xid == null) {
        throw new XAException();
    }

    try {
        if (!xid.equals(this.currentXid)) {
            XAConnection toSwitchTo = findConnectionForXid(this.underlyingConnection, xid);
            this.currentXAConnection = toSwitchTo;
            this.currentXid = xid;
            this.currentXAResource = toSwitchTo.getXAResource();
        }
    } catch (SQLException sqlEx) {
        throw new XAException();
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:17,代码来源:SuspendableXAConnection.java

示例4: commit

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
@Override
public void commit(Xid xid, boolean onePhase) throws XAException {
    if ( xid == null || !xid.equals( currentXid ) ) {
        throw new XAException( "Invalid xid to transactionCommit" );
    }

    currentXid = null;
    try {
        connection.transactionCommit();
        connection.transactionEnd();
    } catch ( Exception t ) {
        throw new XAException( "Error trying to transactionCommit local transaction: " + t.getMessage() );
    }
}
 
开发者ID:agroal,项目名称:agroal,代码行数:15,代码来源:LocalXAResource.java

示例5: rollback

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
@Override
public void rollback(Xid xid) throws XAException {
    if ( xid == null || !xid.equals( currentXid ) ) {
        throw new XAException( "Invalid xid to transactionRollback" );
    }

    currentXid = null;
    try {
        connection.transactionRollback();
        connection.transactionEnd();
    } catch ( Exception t ) {
        throw new XAException( "Error trying to transactionRollback local transaction: " + t.getMessage() );
    }
}
 
开发者ID:agroal,项目名称:agroal,代码行数:15,代码来源:LocalXAResource.java

示例6: start

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
public void start(Xid xid, int flags) throws XAException {

        // Comment out following debug statement before public release:
/*
        System.err.println("STARTING NEW Xid: " + xid);
*/
        if (state != XA_STATE_INITIAL && state != XA_STATE_DISPOSED
                && state != XA_STATE_ENDED) {
            throw new XAException("Invalid XAResource state");
        }

        if (xaDataSource == null) {
            throw new XAException(
                "JDBCXAResource has not been associated with a XADataSource");
        }

        if (xid == null) {

            // This block asserts that all JDBCXAResources with state
            // >= XA_STATE_STARTED have a non-null xid.
            throw new XAException("Null Xid");
        }

        try {
            if (connection.getAutoCommit()) {
                originalAutoCommitMode = true;      // real/phys.

                connection.setAutoCommit(false);    // real/phys.
            }
        } catch (SQLException se) {
            throw new XAException(se.toString());
        }

        if (!xid.equals(this.xid)) {
            this.xid = xid;

            xaDataSource.addResource(this.xid, this);
        }

        state = XA_STATE_STARTED;

        // N.b.  The DataSource does not have this XAResource in its list
        // until right here.  We can't tell DataSource before our start()
        // method, because we don't know our Xid before now.
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:46,代码来源:JDBCXAResource.java

示例7: end

import javax.transaction.xa.Xid; //导入方法依赖的package包/类
@Override
public void end(Xid xid, int flags) throws XAException {
    if ( xid == null || !xid.equals( currentXid ) ) {
        throw new XAException( "Invalid xid to transactionEnd" );
    }
}
 
开发者ID:agroal,项目名称:agroal,代码行数:7,代码来源:LocalXAResource.java


注:本文中的javax.transaction.xa.Xid.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。