2.10.2.1  Atomicity Test 1

a.  Choose a customer who has a bad credit by looking in the C_CUSTOMER
    table for a customer with the C_CREDIT field equal to 'BC'.

        db2 => select C_ID from C_CUSTOMER where C_CREDIT = 'BC' fetch first 1 row only

	C_ID
	-----------
          6

        1 record(s) selected.


b.  Modify the debug level in the OrderEnt bean deployment to 4 so the
    code will print the order ID as soon as it generates it.

	Changed the deployment descriptor for orders.jar to set a debugLevel
	of 4 for OrderEnt.


c.  Enter a new order for this customer using the web client application,
    distributed as part of the SPECjAppServer2002 Kit.  Note the order ID
    printed by the bean code.  The transaction should fail generating an
    InsufficientCreditException.
    
	An order with one item was created for the customer found in a.
	Upon submitting the order, the following message was displayed by
	the browser:

		Credit check failed. Insufficient credit for the customer id
		entered

	The standard error log reports the following, showing order id 100251:
        
[6/10/03 10:39:25:531 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(OrderCmp20EJB.java:472)
: found SequenceSesHome interface
[6/10/03 10:39:25:562 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(OrderCmp20EJB.java:480)
: found CustomerEntHome interface
[6/10/03 10:39:25:578 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(OrderCmp20EJB.java:488)
: found LargeOrderSesHome interface
[6/10/03 10:39:25:578 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(OrderCmp20EJB.java:493)
: found ItemEntHomeLocal interface
[6/10/03 10:39:25:578 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(OrderCmp20EJB.java:498)
: found OrderLineEntHomeLocal interface
[6/10/03 10:39:25:578 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(OrderCmp20EJB.java:107)
: ejbCreate 
[6/10/03 10:39:25:656 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(OrderCmp20EJB.java:115)
: Atomicity Test (1,2,3): Order Id: 100251
[6/10/03 10:39:25:656 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbPostCreate(OrderCmp20EJB.java:149)
: Atomicity Test 3: OrderLineId: 1
[6/10/03 10:39:25:688 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPriceWithDiscount(OrderCmp20EJB.java:520)
: getPriceWithDiscount 
[6/10/03 10:39:25:703 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPercentDiscount(OrderCmp20EJB.java:592)
: getPercentDiscount
[6/10/03 10:39:25:703 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.findCustomer(OrderCmp20EJB.java:540)
: findCustomer
[6/10/03 10:39:25:844 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkCustomerCredit(OrderCmp20EJB.java:568)
: checkCustomerCredit 
[6/10/03 10:39:25:844 EDT] 17132540 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.unsetEntityContext(OrderCmp20EJB.java:514)
: unsetEntityContext 


d.  Retrieve the status of the noted order ID in step c. The order should
    not exist.

	Attempting to retrieve the order status resulted in an exception:

		Remote Exception Occured in getOrderStatus

	indicating that the order does not exist.


e.  Query the database table O_ORDERLINE for rows where OL_O_ID match the
    order ID printed in step c.  There should be no rows returned.

	
	db2 => select * from O_ORDERLINE where OL_O_ID=100251

	OL_ID       OL_O_ID     OL_I_ID         OL_QTY      OL_STATUS   OL_SHIP_DATE
	----------- ----------- --------------- ----------- ----------- ------------

  	0 record(s) selected.                                                             

	No data selected for output.

Test was successful.
