/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
//import com.sun.jts.etsjdbc.odbc.NativeXAResourceImpl;
/* An implementation of org.omg.CosTransactions.Resource to support
*/
/*
Logger to log transaction messages
*/
/**
* Construct an XAResource object.
*
* @param xid the global transaction identifier
* @param xaRes the XAServer object associated with the resource manager
*/
}
/**
* Commit a transaction.
*
* @exception NotPrepared the resource manager has not been called
* for prepare.
* @exception HeuristicRollback a heuristic decision has been made,
* and the resource rolledback.
* @exception HeuristicHazard a heuristic decision has been made,
* but the disposition of
* the resource is unknown.
* @exception HeuristicMixed a heuristic decision has been made, some
* updates have been commited
* and others rolled back.
* @exception SystemException an unindentified error has been reported
* by the resource manager.
*/
//ensureInitialized();
try {
destroy();
if (!(ex instanceof XAException)) {
throw internal;
}
// Can't throw HeuristicCommit exception because org.omg.CosTransactions.ResourceOperations#commit
// doesn't declare it
throw hh;
}
throw new TRANSIENT();
}
throw internal;
}
destroy();
return;
}
/**
* Commit a transaction, using one-phase optimization.
*
* @exception HeuristicHazard a heuristic decision has been made,
* but the disposition of
* the resource is unknown.
* @exception SystemException an unindentified error has been reported
* by the resource manager.
*/
//ensureInitialized();
try {
destroy();
if (!(ex instanceof XAException)) {
throw internal;
}
/** XA_HEURMIX should translate to HeuristicMixedException
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;
**/
throw new TRANSIENT();
// Use HeuristicHazard as a temp exception because CosTransactions.idl Resource
// has commit_one_phase() defined to throw only HeuristicHazard
throw hazex;
}
//IASRI END 4722883
}
throw internal;
}
destroy();
return;
}
/**
* The resource manager can forget all knowledge of the transaction.
*
*/
public void forget() {
//ensureInitialized();
// Perform the XA operation.
try {
} catch (XAException e) {
// currently do nothing..
}
destroy();
return;
}
/**
* Prepare a transaction.
*
* <p>This is the first phase of the two-phase commit protocol.
*
* @exception HeuristicHazard a heuristic decision has been made,
* but the disposition of
* the resource is unknown.
* @exception HeuristicMixed a heuristic decision has been made,
* some updates have been commited
* and others rolled back.
*/
//ensureInitialized();
// Perform the XA operation.
try {
} catch (XAException e) {
// currently do nothing..
throw new RuntimeException(e);
}
}
// Convert to Vote
return Vote.VoteCommit;
}
destroy();
return Vote.VoteReadOnly;
}
destroy();
return null;
}
destroy();
}
/**
* Rollback a transaction.
*
* @exception HeuristicCommit a heuristic decision has been made,
* and the resource committed.
* @exception HeuristicHazard a heuristic decision has been made,
* but the disposition of
* the resource is unknown.
* @exception HeuristicMixed a heuristic decision has been made,
* some updates have been commited
* and others rolled back.
* @exception SystemException an unindentified error has been reported
* by the resource manager
*/
//ensureInitialized();
try {
// this block will be entered during recovery processing.
// there is no tranState object available during recovery.
} else {
// need to worry about asynchronous rollback
}
destroy();
if (!(ex instanceof XAException)) {
throw internal;
}
throw new TRANSIENT();
}
// Can't throw HeuristicRollback exception because org.omg.CosTransactions.ResourceOperations#rollback
// doesn't declare it
throw hh;
}
throw internal;
}
destroy();
return;
}
/**
* Return the global transaction identifier.
*
* @return the global transaction identifier as defined
* by org.omg.CosTransactions.otid_t
*
*/
return otid;
}
/**
* Returns the CORBA Object which represents this object.
*
* @return The CORBA object.
*
*/
return this;
}
}
try {
poa.activate_object(this);
//thisRef = (com.sun.jts.jtsxa.OTSResource)this;
"jts.create_xaresource_object_error");
}
}
return thisRef;
}
}
/**
* Destroy the OTSResourceImpl object.
*
* @param servant the object to be destroyed.
*
*/
private void destroy() {
try {
}
}
}
/**
* 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);
}
}
*/
/*
* These methods are there to satisy the compiler. At some point
* when we move towards a tie based model, the org.omg.Corba.Object
* interface method implementation below shall be discarded.
*/
}
public void _release() {
}
}
}
public boolean _non_existent() {
}
}
}
NamedValue result) {
}
}
}
}
}
}
}