I am test JBoss and POstgres , Setup 2 PCs with WIN95 and 4 terminal 
MSDOS per PC. Run my program test for realize 20,000 operation of the 
form follow:

20,000  insert
20,000  query
20,000  modify
20,000  query
20,000  delete

when the process finishing the 20,000 query throw the message:

2:49:53 | Error Query :java.rmi.ServerException: RemoteException 
occurred in server thread; nested exception is:
        javax.transaction.TransactionRolledbackException: null; nested 
exception is:
        java.rmi.NoSuchObjectException; nested exception is:
        javax.transaction.TransactionRolledbackException: null; nested 
exception is:
        java.rmi.NoSuchObjectException

2:49:53 | Error Query :java.rmi.ServerException: RemoteException 
occurred in server thread; nested exception is:
        javax.transaction.TransactionRolledbackException: Could not 
activate; nested exception is:
        java.io.FileNotFoundException: 
/usr/local/JBoss-2.2.2_Tomcat-3.2.2/jboss/db/sessions/PacientController/996708976340.ser
 
(No such file or directory); nested exception is:
        java.rmi.NoSuchObjectException: Could not activate; nested 
exception is:
        java.io.FileNotFoundException: 
/usr/local/JBoss-2.2.2_Tomcat-3.2.2/jboss/db/sessions/PacientController/996708976340.ser
 
(No such file or directory)
2:49:53 | Error Query :java.rmi.ServerException: RemoteException 
occurred in server thread; nested exception is:
        javax.transaction.TransactionRolledbackException: Could not 
activate; nested exception is:
        java.io.FileNotFoundException: 
/usr/local/JBoss-2.2.2_Tomcat-3.2.2/jboss/db/sessions/PacientController/996708976340.ser
 
(No such file or directory); nested exception is:
        java.rmi.NoSuchObjectException: Could not activate; nested 
exception is:
        java.io.FileNotFoundException: 
/usr/local/JBoss-2.2.2_Tomcat-3.2.2/jboss/db/sessions/PacientController/996708976340.ser
 
(No such file or directory)

The source of my program is :


///////////////////////////////////////////////////////////
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.rmi.RemoteException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
import javax.ejb.FinderException;
import javax.ejb.RemoveException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import testing.ejb.pacient.PacientControllerHome;
import testing.ejb.pacient.PacientController;
import testing.util.LogFile;
import testing.util.CodedNames;
import testing.util.PacientDetails;
import testing.util.EJBGetter;

//
public class Testing {

    private static PacientControllerHome m_pacientControllerHome = 
null;
    private static PacientController m_pacientController = null;

    ////////////////////////////////////////////////////////
    public static void main(String[] args) {

        float  ini  = (new Float(args[0])).floatValue();
        float  size = (new Float(args[1])).floatValue();
        LogFile.openLogFile(args[2]);

        LogFile.log("******  L I N K   A P P   S E R V E R  ******");

        try {
            m_pacientControllerHome = 
EJBGetter.getPacientControllerHome();
            m_pacientController = m_pacientControllerHome.create();
        } catch (Exception e) {
            System.err.println("Cannot lookup PacientHome " +e);
            LogFile.log("Cannot lookup PacientHome " +e);
            System.exit(2);
        }

        // run Testing
        LogFile.log("******    S T A R T   T E S T I N G    ******");
        LogFile.log("******     S T A R T   I N S E R T     ******");
        runTestingInsert(ini,size);
        LogFile.log("******      S T A R T   Q U E R Y      ******");
        runTestingQuery(ini,size);
        LogFile.log("******     S T A R T   M O D I F Y     ******");
        runTestingModify(ini,size);
        LogFile.log("******      S T A R T   Q U E R Y      ******");
        runTestingQuery(ini,size);
        LogFile.log("******     S T A R T   D E L E T E     ******");
        runTestingDelete(ini,size);
        LogFile.log("******      E N D   T E S T I N G      ******");
    }

    //////////////////////////////////////////////////////
    static void runTestingInsert(float ini, float size ){
        String strcodigo;
        String strnombre;
        String strapepat;
        String strapemat;
        for (float i=ini; i<ini+size; i++){
            //System.out.println(FloatToString(i));
            strcodigo=FloatToString(i);
            strnombre=strcodigo.substring(2,10);
            strapepat=strcodigo.substring(4,10);
            strapemat=strcodigo.substring(6,10);
            // insert
            try{
                
m_pacientController.createPacient(strcodigo,strnombre,strapepat,strapemat);
                System.out.println("Register:"+strcodigo);
                LogFile.log("Register:"+strcodigo);
            }catch (Exception e){
                //System.out.println(e.getMessage());
                System.out.println("Error Register :"+ e);
                LogFile.log("Error Register :"+ e);
            }
        }
    }

    /////////////////////////////////////////////////////
    static void runTestingModify(float ini, float size ){
        String strcodigo;
        String strnombre;
        String strapepat;
        String strapemat;

        for (float i=ini; i<ini+size; i++){
            //System.out.println(FloatToString(i));
            strcodigo=FloatToString(i);
            // modify
            try{
                strnombre=strcodigo;
                strapepat=strcodigo;
                strapemat=strcodigo;
                //
                                                                
                                
m_pacientController.setName(strcodigo,strnombre,strapepat,strapemat);
                // modify data
                System.out.println("Modify:"+strcodigo);
                LogFile.log("Modify:"+strcodigo);
            }catch (Exception e){
                //System.out.println( e.getMessage());
                System.out.println("Error Modify :"+ e);
                LogFile.log("Error Modify :"+ e);
            }
        }
    }

    /////////////////////////////////////////////////////
    static void runTestingDelete(float ini, float size ){
        String strcodigo;
        String strnombre;
        String strapepat;
        String strapemat;

        for (float i=ini; i<ini+size; i++){
            //System.out.println(FloatToString(i));
            strcodigo=FloatToString(i);
            // modify
            try{
                m_pacientController.removePacient(strcodigo);
                System.out.println("Delete:"+strcodigo);
                LogFile.log("Delete:"+strcodigo);
            }catch (Exception e){
                //System.out.println( e.getMessage());
                System.out.println("Error Delete :"+ e);
                LogFile.log("Error Delete :"+ e);
            }
        }
    }

    /////////////////////////////////////////////////////
     static void runTestingQuery(float ini, float size ){
        String strcodigo;
        String strnombre;
        String strapepat;
        String strapemat;

        for (float i=ini; i<ini+size; i++){
            //System.out.println(FloatToString(i));
            strcodigo=FloatToString(i);
            // query register
            try{
                PacientDetails pd =                     
                        m_pacientController.getDetails(strcodigo);
                // get data
                strnombre=pd.getNombre();
                strapepat=pd.getApPat();
                strapemat=pd.getApMat();
                // print data
                System.out.println("Query:"+strcodigo);
                LogFile.log("Query:"+strcodigo);
            }catch (Exception e){
                //System.out.println( e.getMessage());
                System.out.println("Error Query :"+ e);
                LogFile.log("Error Query :"+ e);
            }
        }
    }

    ////////////////////////////////////////////
    static String FloatToString(float cod){
        Float actual = new Float(cod+1);
        String talla = String.valueOf(actual);
        String str = talla.substring(0, talla.indexOf('.'));
        int numc=10-str.length();
        String ceros="";
        for (int  i=0; i<numc;i++ ) ceros=ceros+"0";

        return ceros+str;
    }
}






"

Reply via email to