FileDocCategorySizeDatePackage
SybaseXAResource.javaAPI DocGlassfish v2 API4275Fri May 04 22:35:58 BST 2007com.sun.enterprise.transaction

SybaseXAResource

public class SybaseXAResource extends XAResourceWrapper
XA Resource wrapper class for sybase XA Resource with jConnect 5.2.
author
Bala Dutt
version
1.0

Fields Summary
private static com.sun.enterprise.util.i18n.StringManager
sm
Constructors Summary
Methods Summary
public voidcommit(javax.transaction.xa.Xid xid, boolean flag)

        try{
            m_xacon.getXAResource().commit(xid, flag);
        }catch(ResourceException e){
            //a bad xa connection given...
            throw new XAException(sm.getString("transaction.sybase_xa_wrapper_connection_failed",e));
            // throw new XAException("sybase XA resource wrapper :Could not connect : sqlexception was "+e);
        }
    
public javax.transaction.xa.Xid[]recover(int flag)
Returns xids list for recovery depending on flags. Sybase XA Resource ignores the flags for XAResource recover call. This method takes care for the fault. Allows the recover call only for TMSTARTRSCAN, for other values of flags just returns null.

param
flag an int value
return
a Xid[] value
exception
XAException if an error occurs

                                                            
        
        try{
            if(flag==XAResource.TMSTARTRSCAN)
                return m_xacon.getXAResource().recover(flag);
        }catch(ResourceException e){
            //a bad xa connection given...
            // throw new XAException("sybase XA resource wrapper : Could not connect : sqlexception was "+e);
            throw new XAException(sm.getString("transaction.sybase_xa_wrapper_connection_failed",e));
        }
        return null;
    
public voidrollback(javax.transaction.xa.Xid xid)

        try{
            m_xacon.getXAResource().rollback(xid);
        }catch(ResourceException e){
            //a bad xa connection given...
            throw new XAException(sm.getString("transaction.sybase_xa_wrapper_connection_failed",e));
            // throw new XAException("sybase XA resource wrapper :Could not connect : sqlexception was "+e);
        }