Package com.arjuna.ats.arjuna.state

Examples of com.arjuna.ats.arjuna.state.InputObjectState


    Xid[] indoubt = null;

    try
    {
      ObjectStore objStore = new ObjectStore(TxControl.getActionStoreType());
      InputObjectState states = new InputObjectState();

      // only look in the JCA section of the object store

      if (objStore.allObjUids(ServerTransaction.getType(), states) && (states.notempty()))
      {
        Stack values = new Stack();
        boolean finished = false;

        do
View Full Code Here


      catch (final Exception ex)
      {
      }
    }

    InputObjectState ios = new InputObjectState();
    boolean passed = false;
   
    try
    {
      TxControl.getStore().allObjUids(new AtomicAction().type(), ios, ObjectStore.OS_UNKNOWN);
View Full Code Here

public class apache_driver extends JDBCImple
{
    public InputObjectState read_state (Uid objUid, String tName, int ft, String tableName) throws ObjectStoreException
    {
        InputObjectState newImage = null;

        if (!storeValid())
            return newImage;

        if (tName != null)
        {
            if ((ft == ObjectStore.OS_COMMITTED) || (ft == ObjectStore.OS_UNCOMMITTED))
            {
                int pool = getPool();
                ResultSet rs = null;
                try
                {
                    PreparedStatement pstmt = _preparedStatements[pool][READ_STATE];
                    if (pstmt == null)
                    {
                        pstmt = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ?");
                        _preparedStatements[pool][READ_STATE] = pstmt;
                    }

                    pstmt.setString(1, objUid.stringForm());
                    pstmt.setString(2, tName);
                    pstmt.setInt(3, ft);

                    rs = pstmt.executeQuery();

                    if(! rs.next()) {
                        return null; // no matching state in db
                    }
                    Blob myBlob = (Blob)rs.getBlob(1);
                    byte[] buffer = myBlob.getBytes(1, (int)myBlob.length());

                    if (buffer != null)
                    {
                        newImage = new InputObjectState(objUid, tName, buffer);
                    }
                    else {
                        if (tsLogger.arjLoggerI18N.isWarnEnabled())
                            tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.jdbc.oracle_1");
                    }
View Full Code Here

{
    private static final int MAX_RETRIES = 10 ;
   
  public InputObjectState read_state (Uid objUid, String tName, int ft, String tableName) throws ObjectStoreException
  {
    InputObjectState newImage = null;

    if (!storeValid())
      return newImage;

    if (tName != null)
    {
      if ((ft == ObjectStore.OS_COMMITTED) || (ft == ObjectStore.OS_UNCOMMITTED))
      {
        int pool = getPool();
        ResultSet rs = null;

                try
                {
                    for(int count = 0 ; count < MAX_RETRIES ; count++)
                    {
                try
                {
                  PreparedStatement pstmt = _preparedStatements[pool][READ_STATE];
       
                  if (pstmt == null)
                  {
                    pstmt = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ?");
       
                    _preparedStatements[pool][READ_STATE] = pstmt;
                  }
       
                  pstmt.setString(1, objUid.stringForm());
                  pstmt.setString(2, tName);
                  pstmt.setInt(3, ft);
       
                  rs = pstmt.executeQuery();
       
                  if(! rs.next()) {
                    return null; // no matching state in db
                  }
                 
                  Blob myBlob = (Blob)rs.getBlob(1);
                  byte[] buffer = myBlob.getBytes(1, (int)myBlob.length());
       
                  if (buffer != null)
                  {
                    newImage = new InputObjectState(objUid, tName, buffer);
                  }
                  else {
                      if (tsLogger.arjLoggerI18N.isWarnEnabled())
                    tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.jdbc.oracle_1");
                  }
View Full Code Here

      Vector matchingUidVector = new Vector();
      Vector matchingUidTypeVector = new Vector();
     
      try
      {
         InputObjectState types = new InputObjectState();

         // find all types
         if ( _objectStore.allTypes(types) )
         {
            String theTypeName = null;

            try
            {
               boolean endOfList = false;

               while ( !endOfList )
               {
                  // extract a type
                  theTypeName = types.unpackString();

                  if ( theTypeName.compareTo("") == 0 )
                  {
                     endOfList = true;
                  }
                  else
                  {
                     InputObjectState uids = new InputObjectState();

                     try
                     {
                        boolean endOfUids = false;
View Full Code Here

public class oracle_8_0_driver extends JDBCImple
{
  public InputObjectState read_state (Uid objUid, String tName, int ft, String tableName) throws ObjectStoreException
  {
    InputObjectState newImage = null;

    if (!storeValid())
      return newImage;

    if (tName != null)
    {
      if ((ft == ObjectStore.OS_COMMITTED) || (ft == ObjectStore.OS_UNCOMMITTED))
      {
        int pool = getPool();
        ResultSet rs = null;

        try
        {
          PreparedStatement pstmt = _preparedStatements[pool][READ_STATE];

          if (pstmt == null)
          {
            pstmt = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ?");

            _preparedStatements[pool][READ_STATE] = pstmt;
          }

          pstmt.setString(1, objUid.stringForm());
          pstmt.setString(2, tName);
          pstmt.setInt(3, ft);

          rs = pstmt.executeQuery();

          if( ! rs.next()) {
            return null; // no matching state in db
          }

          byte[] buffer = rs.getBytes(1);

          rs.close();

          if (buffer != null)
          {
            newImage = new InputObjectState(objUid, tName, buffer);
          }
          else {
              tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.drivers.oracle_8_0_1");
                    }
        }
View Full Code Here

public class sqlserver_driver extends JDBCImple
{
  public InputObjectState read_state (Uid objUid, String tName, int ft, String tableName) throws ObjectStoreException
  {
    InputObjectState newImage = null;

    if (!storeValid())
      return newImage;

    if (tName != null)
    {
      if ((ft == ObjectStore.OS_COMMITTED) || (ft == ObjectStore.OS_UNCOMMITTED))
      {
        int pool = getPool();
        ResultSet rs = null;

        try
        {
          PreparedStatement pstmt = _preparedStatements[pool][READ_STATE];

          if (pstmt == null)
          {
            pstmt = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ?");

            _preparedStatements[pool][READ_STATE] = pstmt;
          }

          pstmt.setString(1, objUid.stringForm());
          pstmt.setString(2, tName);
          pstmt.setInt(3, ft);

          rs = pstmt.executeQuery();

          if(! rs.next()) {
            return null; // no matching state in db
          }
         
          byte[] buffer = rs.getBytes(1);

          if (buffer != null)
          {
            newImage = new InputObjectState(objUid, tName, buffer);
          }
          else {
              if (tsLogger.arjLoggerI18N.isWarnEnabled())
            tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.jdbc.sqlserver_1");
          }
View Full Code Here

    public void updateTSMI()
    {
  boolean tsmis = false ;
 
  InputObjectState uids = new InputObjectState() ;
  Vector tsmiVector = new Vector() ;
 
  try
  {
      tsmis = _objStore.allObjUids( _typeName, uids ) ;
View Full Code Here

    private InputObjectState read(Uid u, String tn, int state) throws ObjectStoreException
    {
        if(stateMap.containsKey(u)) {
            byte[] data = stateMap.get(u);
            InputObjectState new_image = new InputObjectState(u, tn, data);
            return new_image;
        } else {
            return null;
        }
    }
View Full Code Here

   {
      // Transaction type
      boolean AtomicActions = false ;

      // uids per transaction type
      InputObjectState aa_uids = new InputObjectState() ;

      try
      {
    if (tsLogger.arjLogger.isDebugEnabled())
    {
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.state.InputObjectState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.