本文整理了Java中org.bytesoft.transaction.supports.resource.XAResourceDescriptor.getDelegate()
方法的一些代码示例,展示了XAResourceDescriptor.getDelegate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceDescriptor.getDelegate()
方法的具体详情如下:
包路径:org.bytesoft.transaction.supports.resource.XAResourceDescriptor
类名称:XAResourceDescriptor
方法名:getDelegate
暂无
代码示例来源:origin: liuyangming/ByteTCC
try {
XAResourceDescriptor descriptor = resourceDeserializer.deserialize(identifier);
RecoveredResource resource = (RecoveredResource) descriptor.getDelegate();
resource.recoverable(current.getCompensableXid());
代码示例来源:origin: org.bytesoft/bytejta-supports
public Connection getConnection() throws SQLException {
try {
Transaction transaction = (Transaction) this.transactionManager.getTransaction();
if (transaction == null) {
return this.dataSource.getConnection();
}
XAResourceDescriptor descriptor = transaction.getResourceDescriptor(this.beanName);
LocalXAResource resource = descriptor == null ? null : (LocalXAResource) descriptor.getDelegate();
LocalXAConnection xacon = resource == null ? null : resource.getManagedConnection();
if (xacon != null) {
return xacon.getConnection();
}
xacon = this.getXAConnection();
LogicalConnection connection = xacon.getConnection();
descriptor = xacon.getXAResource();
LocalXAResource localXARes = (LocalXAResource) descriptor.getDelegate();
TransactionContext transactionContext = transaction.getTransactionContext();
boolean loggingRequired = LocalXACompatible.class.isInstance(transactionContext) //
? ((LocalXACompatible) transactionContext).compatibleLoggingLRO() : false;
localXARes.setLoggingRequired(loggingRequired);
transaction.enlistResource(descriptor);
return connection;
} catch (SystemException ex) {
throw new SQLException(ex);
} catch (RollbackException ex) {
throw new SQLException(ex);
} catch (RuntimeException ex) {
throw new SQLException(ex);
}
}
代码示例来源:origin: liuyangming/ByteJTA
public Connection getConnection() throws SQLException {
try {
Transaction transaction = (Transaction) this.transactionManager.getTransaction();
if (transaction == null) {
return this.dataSource.getConnection();
}
XAResourceDescriptor descriptor = transaction.getResourceDescriptor(this.beanName);
LocalXAResource resource = descriptor == null ? null : (LocalXAResource) descriptor.getDelegate();
LocalXAConnection xacon = resource == null ? null : resource.getManagedConnection();
if (xacon != null) {
return xacon.getConnection();
}
xacon = this.getXAConnection();
LogicalConnection connection = xacon.getConnection();
descriptor = xacon.getXAResource();
LocalXAResource localXARes = (LocalXAResource) descriptor.getDelegate();
TransactionContext transactionContext = transaction.getTransactionContext();
boolean loggingRequired = LocalXACompatible.class.isInstance(transactionContext) //
? ((LocalXACompatible) transactionContext).compatibleLoggingLRO() : false;
localXARes.setLoggingRequired(loggingRequired);
transaction.enlistResource(descriptor);
return connection;
} catch (SystemException ex) {
throw new SQLException(ex);
} catch (RollbackException ex) {
throw new SQLException(ex);
} catch (RuntimeException ex) {
throw new SQLException(ex);
}
}
代码示例来源:origin: org.bytesoft/bytejta-supports
public Connection getConnection(String username, String password) throws SQLException {
try {
Transaction transaction = (Transaction) this.transactionManager.getTransaction();
if (transaction == null) {
return this.dataSource.getConnection(username, password);
}
XAResourceDescriptor descriptor = transaction.getResourceDescriptor(this.beanName);
LocalXAResource resource = descriptor == null ? null : (LocalXAResource) descriptor.getDelegate();
LocalXAConnection xacon = resource == null ? null : resource.getManagedConnection();
if (xacon != null) {
return xacon.getConnection();
}
xacon = this.getXAConnection(username, password);
LogicalConnection connection = xacon.getConnection();
descriptor = xacon.getXAResource();
LocalXAResource localXARes = (LocalXAResource) descriptor.getDelegate();
TransactionContext transactionContext = transaction.getTransactionContext();
boolean loggingRequired = LocalXACompatible.class.isInstance(transactionContext) //
? ((LocalXACompatible) transactionContext).compatibleLoggingLRO() : false;
localXARes.setLoggingRequired(loggingRequired);
transaction.enlistResource(descriptor);
return connection;
} catch (SystemException ex) {
throw new SQLException(ex);
} catch (RollbackException ex) {
throw new SQLException(ex);
} catch (RuntimeException ex) {
throw new SQLException(ex);
}
}
代码示例来源:origin: liuyangming/ByteJTA
public Connection getConnection(String username, String password) throws SQLException {
try {
Transaction transaction = (Transaction) this.transactionManager.getTransaction();
if (transaction == null) {
return this.dataSource.getConnection(username, password);
}
XAResourceDescriptor descriptor = transaction.getResourceDescriptor(this.beanName);
LocalXAResource resource = descriptor == null ? null : (LocalXAResource) descriptor.getDelegate();
LocalXAConnection xacon = resource == null ? null : resource.getManagedConnection();
if (xacon != null) {
return xacon.getConnection();
}
xacon = this.getXAConnection(username, password);
LogicalConnection connection = xacon.getConnection();
descriptor = xacon.getXAResource();
LocalXAResource localXARes = (LocalXAResource) descriptor.getDelegate();
TransactionContext transactionContext = transaction.getTransactionContext();
boolean loggingRequired = LocalXACompatible.class.isInstance(transactionContext) //
? ((LocalXACompatible) transactionContext).compatibleLoggingLRO() : false;
localXARes.setLoggingRequired(loggingRequired);
transaction.enlistResource(descriptor);
return connection;
} catch (SystemException ex) {
throw new SQLException(ex);
} catch (RollbackException ex) {
throw new SQLException(ex);
} catch (RuntimeException ex) {
throw new SQLException(ex);
}
}
代码示例来源:origin: org.bytesoft/bytejta-core
XAResource delegate = descriptor.getDelegate();
boolean localFlag = LocalXAResource.class.isInstance(delegate);
代码示例来源:origin: liuyangming/ByteJTA
XAResource delegate = descriptor.getDelegate();
boolean localFlag = LocalXAResource.class.isInstance(delegate);
代码示例来源:origin: org.bytesoft/bytetcc-core
try {
XAResourceDescriptor descriptor = resourceDeserializer.deserialize(identifier);
RecoveredResource resource = (RecoveredResource) descriptor.getDelegate();
resource.recoverable(current.getCompensableXid());
代码示例来源:origin: liuyangming/ByteJTA
XAResource delegate = descriptor.getDelegate();
boolean nativeFlag = LocalXAResource.class.isInstance(delegate);
boolean remoteFlag = RemoteCoordinator.class.isInstance(delegate);
代码示例来源:origin: org.bytesoft/bytejta-core
XAResource delegate = descriptor.getDelegate();
boolean nativeFlag = LocalXAResource.class.isInstance(delegate);
boolean remoteFlag = RemoteCoordinator.class.isInstance(delegate);
内容来源于网络,如有侵权,请联系作者删除!