Hi,
 
we use the JOnAS version 2.1.1. We develop a client-server program and the program runs on windows NT 4.
We have a program which called from the client session a method of the session bean. We keep the instance of the session bean once at the beginning of the client method. Then the program runs in a loop, a method of the session bean is called. This works correct if the loop counter is smaller than 600 or 700. If it is greater we get an error on Jeremie Registry. The error code is OutOfMemoryError. In a further version of JOnAS 1.6.1 with the sun registry (RMI-Registry) the program works correct.
An extract of the program code you can find at the end of the eMail.
 
Have you any ideas to solve the problem?
 
Thanks,
Michael Joos
 
--------------------------------------------------------------------------------------------------------------------
 
client part
 
public void doSaveKeyIn () {
    TableDataSet dataSet = designKeyInPanel.getKeyInData();
    mldg = "";
    try {
      if (serv == null) {
        serv = (ScanDataClassificationService) connectUseCase();
      }
      serv.startFillDt11000();
 
      // rueckwaerts, da die zeilen, die o.k sind, geloescht werden
      for (int i = dataSet.getRowCount()-1; i > -1; i--) {
        DataRow dataRow = new DataRow(dataSet);
        dataSet.getDataRow(i,dataRow);
 
        try {
          // gueltige Paketnr / Scanart / PLZ abhaengig vom land
          if ((checkParcelNumber(dataRow.getString(4))) &&
           (checkScanType(dataRow.getInt(1))) &&
           (checkPlz(dataRow.getInt(7),dataRow.getString(8)))) {
 
          // spalten uebernehmen
            Hashtable newht = new Hashtable();
            newht.put(Dt11000EB.SCANART, Integer.toString(dataRow.getInt(1)));
            newht.put(Dt11000EB.TERM, new Integer(0));
            newht.put(Dt11000EB.TOUR, Integer.toString(dataRow.getInt(2)));
            newht.put(Dt11000EB.ZBZ, dataRow.getString(3));
            newht.put(Dt11000EB.PAKET, dataRow.getString(4));
            newht.put(Dt11000EB.ZCODE, dataRow.getString(5));
            newht.put(Dt11000EB.GEWICHT, dataRow.getBigDecimal(6));
            newht.put(Dt11000EB.LAND, Integer.toString(dataRow.getInt(7)));
            newht.put(Dt11000EB.PLZ, dataRow.getString(8));
            newht.put(Dt11000EB.ROUTE, Integer.toString(dataRow.getInt(9)));
            newht.put(Dt11000EB.PKN, Integer.toString(dataRow.getInt(10)));
            newht.put(Dt11000EB.GKNR, dataRow.getString(11));
            newht.put(Dt11000EB.FREI, "");
            newht.put(Dt11000EB.FTEXT, dataRow.getString(12));
            newht.put(Dt11000EB.KHNR, dataRow.getString(13));
            newht.put(Dt11000EB.AUFTRNR, dataRow.getString(14));
            newht.put(Dt11000EB.IMPORTNR, dataRow.getString(15));
            newht.put(Dt11000EB.SDATUM, dataRow.getDate(16));
            newht.put(Dt11000EB.SZEIT, Integer.toString(dataRow.getInt(17)));
            newht.put(Dt11000EB.VOLUMEN, dataRow.getString(18));
            newht.put(Dt11000EB.VSNUMMER, dataRow.getString(19));
            newht.put(Dt11000EB.LEERZ, "");
            newht.put(Dt11000EB.VSCODE, dataRow.getString(20));
            newht.put(Dt11000EB.NN_BETRAG, dataRow.getBigDecimal(21));
            newht.put(Dt11000EB.BEWERTSTATUS, new Integer(0));
            newht.put(Dt11000EB.STATUS1, new Integer(de.dpd.dp903.ClassificationStates.SCHNELLERFASSUNG));       // Kundenfakturierung
            newht.put(Dt11000EB.STATUS2, new Integer(0));
            newht.put(Dt11000EB.STATUS3, new Integer(0));
            newht.put(Dt11000EB.STATUS4, new Integer(0));
            newht.put(Dt11000EB.STATUS5, new Integer(0));
            newht.put(Dt11000EB.WAE_NR, Short.toString(dataRow.getShort(22)));
            newht.put(Dt11000EB.KUN_NR,(BigDecimal) dataRow.getBigDecimal(0));
            newht.put(Dt11000EB.ERFASSUNGSART, new Integer(de.dpd.dp903.CoverageTypes.SCHNELLERFASSUNG));
 
            serv.fillDt11000(newht);
            dataSet.goToRow(i);
            dataSet.deleteRow();
          } // if zeile ok
        } // try
        catch (Exception exception) {
          mldg = exception + "\n\n" + mldg;
        }
      }  alle zeilen
   }  für dataset exception
   catch (Exception ex) {
     DefaultApplication.exceptionDialog(
    parentFrame,
    GlobalProperties.getString( "de.dpd.global.createError", "Fehler beim Anlegen" ),
    ex );
   }
    finally {
      try {
        serv.endFillDt11000();
      }
      catch (Exception ex) {
      }
    }
 
 // wenn felder falsch gefuellt
   if (mldg != "") {
     DefaultApplication.exceptionDialog(
    parentFrame,
    GlobalProperties.getString("de.dpd.global.createError","Fehler beim Anlegen" ),
    new Exception(mldg));
   }
  }
 
 
----------------------------------------------------------------------------------------------------------------
 
session bean part
  .... 
 
  private PreparedStatement in_dt_11000 = null;
  public void startFillDt11000() throws RemoteException {
    try {
      // Datenbankverbindung herstellen und das prepared Statement vorbereiten.
      if (connection == null) {
        initialContext = qimpl.getContext();
        dataSource = (DataSource) initialContext.lookup( qimpl.getDBConnection() );
        connection = dataSource.getConnection();
      }
      in_dt_11000 = connection.prepareStatement(sqlStatementKeyIn);
    }
    catch (Exception ex) {
       throw new RemoteException(ex.toString());
    };
  }
 
  public boolean fillDt11000 (Hashtable data) throws RemoteException {
    boolean insertOK;
    try {
      in_dt_11000.setInt(1,MaxTable.getNewMaxFromTable("dt11000",qimpl.getContext()).intValue());
 
      in_dt_11000.setInt(2,Integer.parseInt(data.get(Dt11000EB.SCANART).toString()));
      in_dt_11000.setInt(3,((Integer) data.get(Dt11000EB.TERM)).intValue());
     in_dt_11000.setInt(4,Integer.parseInt(data.get(Dt11000EB.TOUR).toString()));
      in_dt_11000.setString(5,(String) data.get(Dt11000EB.ZBZ));
      in_dt_11000.setString(6,(String) data.get(Dt11000EB.PAKET));
    in_dt_11000.setString(7,(String) data.get(Dt11000EB.ZCODE));
      BigDecimal tmp = (BigDecimal) data.get(Dt11000EB.GEWICHT);
      in_dt_11000.setBigDecimal(8,tmp.setScale(2,BigDecimal.ROUND_HALF_UP));
      in_dt_11000.setInt(9,Integer.parseInt(data.get(Dt11000EB.LAND).toString()));
      in_dt_11000.setString(10,(String) data.get(Dt11000EB.PLZ));
      in_dt_11000.setInt(11,Integer.parseInt(data.get(Dt11000EB.ROUTE).toString()));
      in_dt_11000.setInt(12,Integer.parseInt(data.get(Dt11000EB.PKN).toString()));
      in_dt_11000.setString(13,(String) data.get(Dt11000EB.GKNR));
      in_dt_11000.setString(14,(String) data.get(Dt11000EB.FREI));
      in_dt_11000.setString(15,(String) data.get(Dt11000EB.FTEXT));
      in_dt_11000.setString(16,(String) data.get(Dt11000EB.KHNR));
      in_dt_11000.setString(17,(String) data.get(Dt11000EB.AUFTRNR));
      in_dt_11000.setString(18,(String) data.get(Dt11000EB.IMPORTNR));
     in_dt_11000.setDate(19,(java.sql.Date) data.get(Dt11000EB.SDATUM));
      in_dt_11000.setInt(20,Integer.parseInt(data.get(Dt11000EB.SZEIT).toString()));
      in_dt_11000.setString(21,(String) data.get(Dt11000EB.VOLUMEN));
      in_dt_11000.setString(22,(String) data.get(Dt11000EB.VSNUMMER));
      in_dt_11000.setString(23,(String) data.get(Dt11000EB.LEERZ));
      in_dt_11000.setString(24,(String) data.get(Dt11000EB.VSCODE));
      BigDecimal tmp2 = (BigDecimal) data.get(Dt11000EB.NN_BETRAG);
      in_dt_11000.setBigDecimal(25,tmp2.setScale(2,BigDecimal.ROUND_HALF_UP));
      in_dt_11000.setInt(26,((Integer) data.get(Dt11000EB.BEWERTSTATUS)).intValue());
      in_dt_11000.setInt(27,((Integer) data.get(Dt11000EB.STATUS1)).intValue());
      in_dt_11000.setInt(28,((Integer) data.get(Dt11000EB.STATUS2)).intValue());
      in_dt_11000.setInt(29,((Integer) data.get(Dt11000EB.STATUS3)).intValue());
      in_dt_11000.setInt(30,((Integer) data.get(Dt11000EB.STATUS4)).intValue());
      in_dt_11000.setInt(31,((Integer) data.get(Dt11000EB.STATUS5)).intValue());
      in_dt_11000.setInt(32,Integer.parseInt(depot));
      in_dt_11000.setShort(33,Short.parseShort(data.get(Dt11000EB.WAE_NR).toString()));
      in_dt_11000.setInt(34,((Integer) data.get(Dt11000EB.ERFASSUNGSART)).intValue());
      in_dt_11000.setBigDecimal(35,(BigDecimal) data.get(Dt11000EB.KUN_NR));
      insertOK = in_dt_11000.execute();
    }
    catch (Exception ex) {
       throw new RemoteException(ex.toString());
    };
    return insertOK;
  }
 
  /**
    * PreparedStatement fuer die Schnellerfassung wird geschlossen
    */
  public void endFillDt11000() throws RemoteException {
    try {
      in_dt_11000.close();
      in_dt_11000 = null;
    }
    catch (Exception ex) {
       throw new RemoteException(ex.toString());
    };
  }
 
 
 

Reply via email to