Package org.jboss.tutorial.extended.bean

Examples of org.jboss.tutorial.extended.bean.Customer


   public static void testLongLivedSession() throws Exception
   {
      ShoppingCart test = (ShoppingCart) getInitialContext().lookup("ShoppingCartBean/remote");
      StatelessRemote remote = (StatelessRemote) getInitialContext().lookup("StatelessSessionBean/remote");
      Customer c;

      long id = test.createCustomer();
      c = remote.find(id);
      System.out.println("Created customer: " + c.getName());

      test.update();
      c = remote.find(id);
      System.out.println("ShoppingCartBean.customer should stay managed because we're in an extended PC: Customer.getName() == " + c.getName());

      test.update3();
      c = remote.find(id);
      System.out.println("Extended persistence contexts are propagated to nested EJB calls: Customer.getName() == " + c.getName());
      test.checkout();
   }
View Full Code Here


   public static void testWithFlushMode() throws Exception
   {
      ShoppingCart cart = (ShoppingCart) getInitialContext().lookup("ShoppingCartBean/remote");
      StatelessRemote dao = (StatelessRemote) getInitialContext().lookup("StatelessSessionBean/remote");
      Customer c;
      long id;


      id = cart.createCustomer();
      c = dao.find(id);
      System.out.println("Created customer: " + c.getName());

      cart.never();
      c = dao.find(id);
      System.out.println("Customer's name should still be William as pc was not yet flushed:  Customer.getName() == " + c.getName());

      cart.checkout();
      c = dao.find(id);
      System.out.println("Now that the pc has been flushed name should be 'Bob': Customer.getName() == " + c.getName());

   }
View Full Code Here

TOP

Related Classes of org.jboss.tutorial.extended.bean.Customer

Copyright © 2018 www.massapicom. 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.