Examples of EnterpriseEntityHome


Examples of org.jboss.test.deadlock.interfaces.EnterpriseEntityHome

   }

   public void testDeadLock()
      throws Exception
   {
      EnterpriseEntityHome home = (EnterpriseEntityHome) new InitialContext().lookup("nextgenEnterpriseEntity");
      try
      {
         EnterpriseEntity A = home.findByPrimaryKey("A");
      }
      catch (ObjectNotFoundException ex)
      {
         home.create("A");
      }
      try
      {
         EnterpriseEntity B = home.findByPrimaryKey("B");
      }
      catch (ObjectNotFoundException ex)
      {
         home.create("B");
      }
      Thread one = new Thread(new RunTest("AB"));
      Thread two = new Thread(new RunTest("BA"));
      one.start();
      two.start();
View Full Code Here

Examples of org.jboss.test.deadlock.interfaces.EnterpriseEntityHome

      int beanCount = 2;
      completed = 0;
      unexpected = null;

      // Create some beans
      EnterpriseEntityHome home = (EnterpriseEntityHome) new InitialContext().lookup(jndiName);
      for (int i = 0; i < beanCount; i++)
      {
         try
         {
            home.create(new Integer(i).toString());
         }
         catch (DuplicateKeyException weDontCare)
         {
         }
      }
View Full Code Here

Examples of org.jboss.test.deadlock.interfaces.EnterpriseEntityHome

    if (ejbObject == null)
    log.debug("************************** NULL EJBOBJECT");
    else
        log.debug("************************** OK EJBOBJECT");
   
    EnterpriseEntityHome home = (EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome();
      newBean = (EnterpriseEntity)home.create(newName);

   
  }catch(Exception e)
    {
    log.debug("failed", e);
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome

   {
      try
      {
         log.debug("setNextEntity: " + beanName);
         EJBObject ejbObject = entityContext.getEJBObject();
         EnterpriseEntityHome home = (EnterpriseEntityHome) ejbObject.getEJBHome();
         try
         {
            nextEntity = home.findByPrimaryKey(beanName);
         }
         catch (FinderException e)
         {
            nextEntity = home.create(beanName);
         }
         lastEntity = beanName;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome

   static void create() throws Exception
   {
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("EnterpriseEntity_A");
      obj = PortableRemoteObject.narrow(obj, EnterpriseEntityHome.class);
      EnterpriseEntityHome home = (EnterpriseEntityHome)obj;
      try
      {
         home.create("Bean1");
      }
      catch (CreateException e)
      {
      }
   }
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome

   static void remove() throws Exception
   {
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("EnterpriseEntity_A");
      obj = PortableRemoteObject.narrow(obj, EnterpriseEntityHome.class);
      EnterpriseEntityHome home = (EnterpriseEntityHome)obj;
      try
      {
         home.remove("Bean1");
      }
      catch (RemoveException e)
      {
      }
   }
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome

   {
      getLog().debug("+++ testContention()");
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("EnterpriseEntity_A");
      obj = PortableRemoteObject.narrow(obj, EnterpriseEntityHome.class);
      EnterpriseEntityHome home = (EnterpriseEntityHome)obj;
      getLog().debug("Found EnterpriseEntityHome @ jndiName=EnterpriseEntity");
      Run r0 = new Run(home.findByPrimaryKey("Bean1"), getLog());
      Run r1 = new Run(home.findByPrimaryKey("Bean1"), getLog());
      Run r2 = new Run(home.findByPrimaryKey("Bean1"), getLog());
      Thread t0 = new Thread(r0);
      Thread t1 = new Thread(r1);
      Thread t2 = new Thread(r2);
      t0.start();
      Thread.sleep(100);
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome

   {
      super.setUp();
      nbThreads = getThreadCount();//DEFAULT_THREAD_COUNT;
      iterations = getIterationCount();//DEFAULT_ITERATIONS;
      getLog().debug("+++ Setting up: " + getClass().getName() + " test: " + getName());
      EnterpriseEntityHome home =
          (EnterpriseEntityHome)getInitialContext().lookup(jndiname);

      try
      {
         entity = home.findByPrimaryKey("seb");
      }
      catch (FinderException e)
      {
         entity = home.create("seb");
      }

      // setup the threads
      threads = new Worker[nbThreads];
   }
View Full Code Here

Examples of org.jboss.test.testbean.interfaces.EnterpriseEntityHome

         statefulSession = sfHome.create();
        
         StatelessSessionHome slHome = (StatelessSessionHome)ctx.lookup("java:comp/env/ejb/stateless");
         statelessSession = slHome.create();
        
         EnterpriseEntityHome eeHome = (EnterpriseEntityHome)ctx.lookup("java:comp/env/ejb/entity");
         try {
            enterpriseEntity = eeHome.findByPrimaryKey(aString);
         } catch (FinderException e) {
            enterpriseEntity = eeHome.create(aString);
         }
     
      } catch (Exception e) {
         log.debug("failed", e);
         throw new CreateException(e.getMessage());
View Full Code Here

Examples of org.jboss.test.testbean.interfaces.EnterpriseEntityHome

      this.anObject = anObject;
     
      try {
         Context ctx = new InitialContext();
        
         EnterpriseEntityHome eeHome = (EnterpriseEntityHome)ctx.lookup("java:comp/env/ejb/entity");
         try {
            enterpriseEntity = eeHome.findByPrimaryKey(aString);
         } catch (FinderException e) {
            enterpriseEntity = eeHome.create(aString);
         }
     
      } catch (Exception e) {
         // ignore
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.