/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
/** * Invoked for transaction inflow of work * * @param work The work starting * @param xid The xid of the work * @param timeout The transaction timeout * @throws WorkCompletedException with error code WorkException.TX_CONCURRENT_WORK_DISALLOWED * when work is already present for the xid or whose completion is in progress, only * the global part of the xid must be used for this check. */ public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { delegator.registerWork(work, xid, timeout); }
/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
/** * <p> * Interception of register work call to get transaction being imported to wildfly transacton client. * <p> * For importing a transaction Wildfly transaction client eventually calls {@link SubordinationManager} * as Narayana {@link XATerminator}s do. This wrapping then let wildfly transacton client to register the transaction * for itself, wildfly transacton client then import transaction to Narayana too and finally this method * uses Narayana's {@link XATerminator} to register all {@link Work}s binding.<br> * Narayana's {@link XATerminator} tries to import transaction too but as transaction is already * imported it just gets instance of transaction already imported via call of wildfly transacton client. */ @Override public void registerWork(Work work, Xid xid, long timeout) throws WorkCompletedException { try { // jca provides timeout in milliseconds, SubordinationManager expects seconds int timeout_seconds = (int) timeout/1000; // unlimited timeout for jca means -1 which fails in wfly client if(timeout_seconds <= 0) timeout_seconds = ContextTransactionManager.getGlobalDefaultTransactionTimeout(); localTransactionContext.findOrImportTransaction(xid, timeout_seconds); } catch (XAException xae) { throw TransactionLogger.ROOT_LOGGER.cannotFindOrImportInflowTransaction(xid, work, xae); } jbossXATerminator.registerWork(work, xid, timeout); }
workManager.getXATerminator().registerWork(work, xid, timeout);