Class OTSResourceImpl

    • Constructor Detail

      • OTSResourceImpl

        public OTSResourceImpl​(Xid xid,
                               XAResource xaRes,
                               TransactionState tranState)
        Construct an XAResource object.
        Parameters:
        xid - the global transaction identifier
        xaRes - the XAServer object associated with the resource manager
    • Method Detail

      • commit

        public void commit()
                    throws org.omg.CosTransactions.NotPrepared,
                           org.omg.CosTransactions.HeuristicRollback,
                           org.omg.CosTransactions.HeuristicHazard,
                           org.omg.CosTransactions.HeuristicMixed,
                           org.omg.CORBA.SystemException
        Commit a transaction.
        Specified by:
        commit in interface org.omg.CosTransactions.ResourceOperations
        Throws:
        org.omg.CosTransactions.NotPrepared - the resource manager has not been called for prepare.
        org.omg.CosTransactions.HeuristicRollback - a heuristic decision has been made, and the resource rolledback.
        org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
        org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.
        org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager.
      • commit_one_phase

        public void commit_one_phase()
                              throws org.omg.CosTransactions.HeuristicHazard,
                                     org.omg.CORBA.SystemException
        Commit a transaction, using one-phase optimization.
        Specified by:
        commit_one_phase in interface org.omg.CosTransactions.ResourceOperations
        Throws:
        org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
        org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager.
      • forget

        public void forget()
        The resource manager can forget all knowledge of the transaction.
        Specified by:
        forget in interface org.omg.CosTransactions.ResourceOperations
      • prepare

        public org.omg.CosTransactions.Vote prepare()
                                             throws org.omg.CosTransactions.HeuristicHazard,
                                                    org.omg.CosTransactions.HeuristicMixed
        Prepare a transaction.

        This is the first phase of the two-phase commit protocol.

        Specified by:
        prepare in interface org.omg.CosTransactions.ResourceOperations
        Throws:
        org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
        org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.
      • rollback

        public void rollback()
                      throws org.omg.CosTransactions.HeuristicCommit,
                             org.omg.CosTransactions.HeuristicMixed,
                             org.omg.CosTransactions.HeuristicHazard,
                             org.omg.CORBA.SystemException
        Rollback a transaction.
        Specified by:
        rollback in interface org.omg.CosTransactions.ResourceOperations
        Throws:
        org.omg.CosTransactions.HeuristicCommit - a heuristic decision has been made, and the resource committed.
        org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
        org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.
        org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager
      • getGlobalTID

        public org.omg.CosTransactions.otid_t getGlobalTID()
        Return the global transaction identifier.
        Specified by:
        getGlobalTID in interface OTSResourceOperations
        Returns:
        the global transaction identifier as defined by org.omg.CosTransactions.otid_t
      • getCORBAObjReference

        public OTSResource getCORBAObjReference()
        Returns the CORBA Object which represents this object.
        Returns:
        The CORBA object.
      • _duplicate

        public org.omg.CORBA.Object _duplicate()
        Ensure that the Native XA interface is initialized. Invoke the nativeXA initializer to ensure that this resource has had any necessary initialization performed on this thread. This will be necessary in the server environment where we have not been invoked via a transactional flow, and we may very well be executing on a new thread. The resource manager may have specific requirements, but it should not matter if initialization is performed twice. We also call down to the native interface informing that the transaction is about to complete. This permits any database specific action to be performed.prior to the actual xa operations marking completion. private void ensureInitialized() { // COMMENT(Ram J) - we do not support native xa drivers. if (this.xaRes instanceof NativeXAResourceImpl) { NativeXAResourceImpl xaResImpl = (NativeXAResourceImpl) xaRes; xaResImpl.nativeXA.initialize(xaResImpl, xaResImpl.xaswitch, xaResImpl.open, xaResImpl.close, xaResImpl.getRMID(), false); xaResImpl.nativeXA.aboutToComplete(xaResImpl, (XID) xid); } }
        Specified by:
        _duplicate in interface org.omg.CORBA.Object
      • _release

        public void _release()
        Specified by:
        _release in interface org.omg.CORBA.Object
      • _is_a

        public boolean _is_a​(String repository_id)
        Specified by:
        _is_a in interface org.omg.CORBA.Object
        Overrides:
        _is_a in class org.omg.PortableServer.Servant
      • _is_equivalent

        public boolean _is_equivalent​(org.omg.CORBA.Object that)
        Specified by:
        _is_equivalent in interface org.omg.CORBA.Object
      • _non_existent

        public boolean _non_existent()
        Specified by:
        _non_existent in interface org.omg.CORBA.Object
        Overrides:
        _non_existent in class org.omg.PortableServer.Servant
      • _hash

        public int _hash​(int maximum)
        Specified by:
        _hash in interface org.omg.CORBA.Object
      • _request

        public org.omg.CORBA.Request _request​(String operation)
        Specified by:
        _request in interface org.omg.CORBA.Object
      • _create_request

        public org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx,
                                                     String operation,
                                                     org.omg.CORBA.NVList arg_list,
                                                     org.omg.CORBA.NamedValue result)
        Specified by:
        _create_request in interface org.omg.CORBA.Object
      • _create_request

        public org.omg.CORBA.Request _create_request​(org.omg.CORBA.Context ctx,
                                                     String operation,
                                                     org.omg.CORBA.NVList arg_list,
                                                     org.omg.CORBA.NamedValue result,
                                                     org.omg.CORBA.ExceptionList exceptions,
                                                     org.omg.CORBA.ContextList contexts)
        Specified by:
        _create_request in interface org.omg.CORBA.Object
      • _get_interface_def

        public org.omg.CORBA.Object _get_interface_def()
        Specified by:
        _get_interface_def in interface org.omg.CORBA.Object
        Overrides:
        _get_interface_def in class org.omg.PortableServer.Servant
      • _get_policy

        public org.omg.CORBA.Policy _get_policy​(int policy_type)
        Specified by:
        _get_policy in interface org.omg.CORBA.Object
      • _get_domain_managers

        public org.omg.CORBA.DomainManager[] _get_domain_managers()
        Specified by:
        _get_domain_managers in interface org.omg.CORBA.Object
      • _set_policy_override

        public org.omg.CORBA.Object _set_policy_override​(org.omg.CORBA.Policy[] policies,
                                                         org.omg.CORBA.SetOverrideType set_add)
        Specified by:
        _set_policy_override in interface org.omg.CORBA.Object