Methods Summary |
---|
public Request | _create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)
throw no_implement;
|
public Request | _create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts)
throw no_implement;
|
public org.omg.CORBA.Object | _duplicate()
throw no_implement;
|
public org.omg.CORBA.DomainManager[] | _get_domain_managers()
throw no_implement;
|
public org.omg.CORBA.Object | _get_interface_def()
throw no_implement;
|
public org.omg.CORBA.Policy | _get_policy(int policy_type)
throw no_implement;
|
public int | _hash(int maximum)
throw no_implement;
|
public boolean | _is_a(java.lang.String repository_id)
throw no_implement;
|
public boolean | _is_equivalent(org.omg.CORBA.Object that)
throw no_implement;
|
public boolean | _non_existent()
throw no_implement;
|
public void | _release()
throw no_implement;
|
public Request | _request(java.lang.String operation)
throw no_implement;
|
public org.omg.CORBA.Object | _set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)
throw no_implement;
|
public void | commit()Commit a transaction.
//ensureInitialized();
try {
xaRes.commit(xid, false);
} catch (Exception ex) {
destroy();
if (!(ex instanceof XAException)) {
INTERNAL internal = new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
internal.initCause(ex);
_logger.log(Level.WARNING, "jts.unexpected_error_occurred_twopc_commit", ex);
throw internal;
}
XAException e = (XAException) ex;
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "An XAException occurred in twopc commit", e);
if (e.errorCode == XAException.XA_HEURRB)
throw new HeuristicRollback(ex.getMessage());
if (e.errorCode == XAException.XA_HEURHAZ)
throw new HeuristicHazard(ex.getMessage());
if (e.errorCode == XAException.XA_HEURMIX)
throw new HeuristicMixed(ex.getMessage());
if (e.errorCode == XAException.XA_RBPROTO)
throw new NotPrepared(ex.getMessage());
if (e.errorCode == XAException.XA_HEURCOM)
return;
if ((e.errorCode == XAException.XA_RETRY) ||
(e.errorCode == XAException.XA_RBTRANSIENT) ||
(e.errorCode == XAException.XA_RBCOMMFAIL))
throw new TRANSIENT();
if (e.errorCode >= XAException.XA_RBBASE &&
e.errorCode <= XAException.XA_RBEND) {
throw new HeuristicRollback(ex.getMessage());
}
throw new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
}
destroy();
return;
|
public void | commit_one_phase()Commit a transaction, using one-phase optimization.
//ensureInitialized();
try {
xaRes.commit(xid, true);
} catch (Exception ex) {
destroy();
if (!(ex instanceof XAException)) {
INTERNAL internal = new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
internal.initCause(ex);
_logger.log(Level.WARNING, "jts.unexpected_error_occurred_twopc_commit", ex);
throw internal;
}
XAException e = (XAException) ex;
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "An XAException occurred in c_o_p", e);
if (e.errorCode == XAException.XA_HEURRB)
throw new HeuristicHazard(ex.getMessage());
if (e.errorCode == XAException.XA_HEURHAZ)
throw new HeuristicHazard(ex.getMessage());
if (e.errorCode == XAException.XA_HEURMIX)
throw new HeuristicHazard(ex.getMessage());
//IASRI START 4722883
/**
if (e.errorCode >= XAException.XA_RBBASE &&
e.errorCode <= XAException.XA_RBEND)
return;
**/
if (e.errorCode == XAException.XA_HEURCOM)
return;
if ((e.errorCode == XAException.XA_RETRY) ||
(e.errorCode == XAException.XA_RBTRANSIENT) ||
(e.errorCode == XAException.XA_RBCOMMFAIL))
throw new TRANSIENT();
if (e.errorCode >= XAException.XA_RBBASE &&
e.errorCode <= XAException.XA_RBEND) {
HeuristicHazard hazex = new HeuristicHazard();
((Throwable)hazex).initCause((Throwable)ex);
throw hazex;
}
//IASRI END 4722883
INTERNAL internal = new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
internal.initCause(ex);
throw internal;
}
destroy();
return;
|
private void | destroy()Destroy the OTSResourceImpl object.
if (poa != null && thisRef != null) {
try {
poa.deactivate_object(poa.reference_to_id(thisRef));
thisRef = null;
} catch (Exception exc) {
_logger.log(Level.WARNING,"jts.object_destroy_error","OTSResource");
}
}
// finalize();
|
private void | ensureInitialized()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.
/* 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);
}
*/
|
public void | forget()The resource manager can forget all knowledge of the transaction.
//ensureInitialized();
// Perform the XA operation.
try {
xaRes.forget(xid);
} catch (XAException e) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"An XAException occurred in forget", e);
// currently do nothing..
}
destroy();
return;
|
public OTSResource | getCORBAObjReference()Returns the CORBA Object which represents this object.
if (thisRef == null) {
if (poa == null) {
poa = Configuration.getPOA("transient"/*#Frozen*/);
}
try {
poa.activate_object(this);
thisRef = OTSResourceHelper.
narrow(poa.servant_to_reference(this));
//thisRef = (com.sun.jts.jtsxa.OTSResource)this;
} catch (Exception exc) {
_logger.log(Level.SEVERE,"jts.create_xaresource_object_error");
String msg = LogFormatter.getLocalizedMessage(_logger,
"jts.create_xaresource_object_error");
throw new org.omg.CORBA.INTERNAL(msg);
}
}
return thisRef;
|
public otid_t | getGlobalTID()Return the global transaction identifier.
byte[] gtrid = xid.getGlobalTransactionId();
byte[] otidData = new byte[gtrid.length];
System.arraycopy(gtrid,0,otidData,0,gtrid.length);
otid_t otid = new otid_t(xid.getFormatId(),0,otidData);
return otid;
|
public Vote | prepare()Prepare a transaction.
This is the first phase of the two-phase commit protocol.
//ensureInitialized();
int rc = XAException.XAER_PROTO;
// Perform the XA operation.
try {
rc = xaRes.prepare(xid); // xa_prepare()
} catch (XAException e) {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,"An XAException occurred in prepare", e);
// currently do nothing..
if (e.errorCode == XAException.XAER_RMFAIL ||
e.errorCode == XAException.XAER_RMERR) {
throw new RuntimeException(e);
}
}
// Convert to Vote
if (rc == XAResource.XA_OK) {
return Vote.VoteCommit;
}
if (rc == XAResource.XA_RDONLY) {
destroy();
return Vote.VoteReadOnly;
}
if (rc == Configuration.LAO_PREPARE_OK) {
destroy();
return null;
}
destroy();
return Vote.VoteRollback; // Any other return code is rollback
|
public void | rollback()Rollback a transaction.
//ensureInitialized();
try {
if (tranState == null) {
// this block will be entered during recovery processing.
// there is no tranState object available during recovery.
xaRes.rollback(xid);
} else {
// need to worry about asynchronous rollback
tranState.rollback(xaRes);
}
} catch (Exception ex) {
destroy();
if (!(ex instanceof XAException)) {
INTERNAL internal = new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
internal.initCause(ex);
_logger.log(Level.WARNING, "jts.unexpected_error_occurred_twopc_rollback", ex);
throw internal;
}
XAException e = (XAException) ex;
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "An XAException occurred in rollback", e);
if (e.errorCode == XAException.XA_HEURCOM)
throw new HeuristicCommit(ex.getMessage());
if (e.errorCode == XAException.XA_HEURHAZ)
throw new HeuristicHazard(ex.getMessage());
if (e.errorCode == XAException.XA_HEURMIX)
throw new HeuristicMixed(ex.getMessage());
if (e.errorCode == XAException.XA_HEURCOM)
return;
if ((e.errorCode == XAException.XA_RETRY) ||
(e.errorCode == XAException.XA_RBTRANSIENT) ||
(e.errorCode == XAException.XA_RBCOMMFAIL))
throw new TRANSIENT();
INTERNAL internal = new INTERNAL(0,CompletionStatus.COMPLETED_MAYBE);
internal.initCause(ex);
throw internal;
}
destroy();
return;
|
public final java.lang.String | toString()
return new String ("OTSResource : XAResource " +
xaRes + " XID " + xid);
|