2 Replies Latest reply: Jul 18, 2012 3:15 AM by EJP RSS

    Problem in retrieving value via ejb2.0 in stateless container managed bean

    944271
      -----------------------ejb-jar.xml---------------------------------

      <session>
                <description>Entity Bean</description>
                <ejb-name>Stl</ejb-name>
                <local-home>com.ejb.session.ejbeans.StlHome</local-home>
                <local>com.ejb.session.ejbeans.Stl</local>
                <ejb-class>com.ejb.session.ejbeans.StlBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
      </session>



      -----------------------ejb-jar.xml---------------------------------

      --------------------------------------------------StlBean---------------------------------------------------

      public ArrayList setaArrList() throws RemoteException {
      makeConnection();

      try {
      results = statement.executeQuery(aExQry);

      resultsetmetadata = results.getMetaData();
      int i = resultsetmetadata.getColumnCount();
      totcols = i;
      int j = 1;
      ArrayList arr = new ArrayList();
      ArrayList arrnm = new ArrayList();

      while (results.next()) {
      for (int k = 1; k <= i; k++) {
      String s2 = resultsetmetadata.getColumnName(k);
      int coltype = resultsetmetadata.getColumnType(k);
      String s3 = null;

      if(coltype == java.sql.Types.CLOB) {
      Clob fileAsCLOB = null;
      long length = 0;
      fileAsCLOB = results.getClob(resultsetmetadata.getColumnName(k));
      if(fileAsCLOB != null) {
           length = fileAsCLOB.length();
           s3 = fileAsCLOB.getSubString(1, (int) length);
      }
      } else {
      s3 = results.getString(resultsetmetadata.getColumnName(k));
      }


      if (!arrnm.contains(s2)) {
      s2 = setString(s2);
      arrnm.add(s2);
      }

      s3 = setString(s3);
      arr.add(s3);
      }

      j++;
      }


      this.x= arrnm;

      }


      public ArrayList getxArrList() throws RemoteException {
      try {
           return x;
      }
      --------------------------------------------------StlBean---------------------------------------------------

      Problem is with getxArrList() ,We not getting the correct value of x when tested for 2 users.