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
	-----------
              23072

        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 2332501:
        
[11/11/03 16:23:36:403 EST] 54fd225d 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
[11/11/03 16:23:36:406 EST] 54fd225d 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
[11/11/03 16:23:36:409 EST] 54fd225d 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
[11/11/03 16:23:36:422 EST] 54fd225d 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
[11/11/03 16:23:36:427 EST] 54fd225d 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
[11/11/03 16:23:36:430 EST] 54fd225d SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(OrderCmp20EJB.java:107): ejbCreate
[11/11/03 16:23:36:515 EST] 54fd225d 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: 2332501
[11/11/03 16:23:36:520 EST] 54fd225d 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
[11/11/03 16:23:36:527 EST] 54fd225d SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPriceWithDiscount(OrderCmp20EJB.java:520): getPriceWithDiscount
[11/11/03 16:23:36:567 EST] 54fd225d SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPercentDiscount(OrderCmp20EJB.java:592): getPercentDiscount
[11/11/03 16:23:36:568 EST] 54fd225d SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.findCustomer(OrderCmp20EJB.java:540): findCustomer
[11/11/03 16:23:36:737 EST] 54fd225d SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkCustomerCredit(OrderCmp20EJB.java:568): checkCustomerCredit
[11/11/03 16:23:36:739 EST] 54fd225d 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=2332501

	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.

