XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • P4
    • None
    • 1.2.2
    • vm-legacy

    Description



      Name: skT88420 Date: 09/07/99


      Ran a client program that interacts with Java EJB on the server. The source code is quite simple:

      // The next time Dynamo is started, your Account EJB will be available
      // both locally and remotely. Its local JNDI name (for accessing the
      // EJB from within Dynamo) is dynamoejb:/dynamoEJBContainer/Account,
      // and its remote JNDI name is
      // dynamoejb://yourHost:8860/dynamoEJBContainer/Account (assuming that
      // Dynamo's RmiServer is running on port 8860).

      // The following is an example of a standalone client program that
      // accesses the EJB remotely:

      import javax.naming.*;
      import javax.ejb.*;
      import java.rmi.*;

      public class RemoteTest
      {
          public static void main (String [] args)
              throws NamingException, RemoteException
              {
                  String jndiName
                      ="dynamoejb://localhost:8860/dynamoEJBContainer/Account";

                  Context ctx = new InitialContext ();
                  System.out.println ("got context");
                  AccountHome home = (AccountHome) ctx.lookup (jndiName);
                  if (home == null) {
                      System.out.println ("couldn't find home. exiting...");
                      return;
                  }
                  System.out.println ("got account home");
                  Account a = null;
                  int loopMax = 1;
                  try {
                      double start = System.currentTimeMillis ();
                      for (int i=0; i<loopMax; i++) {
                          System.out.println ("going to create home");
                          a = home.create ();
                          System.out.println ("created home");
                      }
                      double end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a = home.create ();\"= "
                                          + (end-start));

                      start = System.currentTimeMillis ();
                      for (int i=0; i<loopMax; i++) {
                          a = home.create ("Joe Blow");
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a = home.create (\"Joe Blow\");\"= "
                                          + (end-start));

                      start = System.currentTimeMillis ();
                      for (int i=0; i<loopMax; i++) {
                          a = home.create (42.30);
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a = home.create (42.30);\"= "
                                          + (end-start));

                      start = System.currentTimeMillis ();
                      for (int i=0; i<loopMax; i++) {
                          a = home.create ("Trinity", 3.14);
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a = home.create (\"Trinity\", 3.14);\"= "
                                          + (end-start));

                      start = end;
                      for (int i=0; i<loopMax; i++) {
                          a.adjustValue (-10.0);
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a.adjustValue (-10.0);\"= "
                                          + (end-start));

                      String tmp;
                      start = end;
                      for (int i=0; i<loopMax; i++) {
                          tmp = a.getName ();
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"tmp = a.getName ();\"= "
                                          + (end-start));
                      
                      start = end;
                      for (int i=0; i<loopMax; i++) {
                          a.setName ("Frank Kim");
                      }
                      end = System.currentTimeMillis ();
                      System.out.println ("delta time for \"a.setName (\"Frank Kim\");\"= "
                                          + (end-start));
                  }
                  finally {
                        try {
                            if (a != null) a.remove ();
                        }
                        catch (javax.ejb.RemoveException xx){}
                  }
              }
      }


      Got the following error:

      A nonfatal internal JIT (3.10.107(x)) error 'VCR64 - TryTemp' has occurred in :

        'RemoteTest.main ([Ljava/lang/String;)V': Interpreting method.
        Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi


      d:/devel/java> java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      d:/devel/java> java -fullversion
      java full version "JDK-1.2.2-W"
      (Review ID: 94966)
      ======================================================================

      Attachments

        Activity

          People

            Unassigned Unassigned
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: