2 Replies Latest reply on Jul 22, 2013 10:05 PM by lee lee

    how do I get the stateful session bean instance once again?

    lee lee Newbie

      my client

      public static RemoteCounter lookupRemoteCounter() throws NamingException {

         final Context context = new InitialContext(jndiProperties);

         final String beanName = CounterBean.class.getSimpleName();

         final String viewClassName = RemoteCounter.class.getName();

         return (RemoteCounter) context.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName+"?stateful");

        }

      public void static main(String[] args){

      RemoteCounter rc = LookupHelper.lookupRemoteCounter();

         rc.increment();

         System.out.println("instance 1:"+rc.getCount());

      }

      On the server side created an instance of RemoteCounter ,how do i get the instance on the client ,once again?

      is the last generation that instance, not a new instance