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

        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 13501:
        
[12/11/02 19:49:16:828 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(Unknown Source)
: found SequenceSesHome interface
[12/11/02 19:49:16:844 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(Unknown Source)
: found CustomerEntHome interface
[12/11/02 19:49:16:844 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(Unknown Source)
: found LargeOrderSesHome interface
[12/11/02 19:49:16:844 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(Unknown Source)
: found ItemEntHomeLocal interface
[12/11/02 19:49:16:859 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext(Unknown Source)
: found OrderLineEntHomeLocal interface
[12/11/02 19:49:16:859 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(Unknown Source)
: ejbCreate 
[12/11/02 19:49:17:516 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(Unknown Source)
: Atomicity Test (1,2,3): Order Id: 13501
[12/11/02 19:49:17:531 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbPostCreate(Unknown Source)
: Atomicity Test 3: OrderLineId: 1
[12/11/02 19:49:17:562 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPriceWithDiscount(Unknown Source)
: getPriceWithDiscount 
[12/11/02 19:49:17:578 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPercentDiscount(Unknown Source)
: getPercentDiscount
[12/11/02 19:49:17:594 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.findCustomer(Unknown Source)
: findCustomer
[12/11/02 19:49:17:750 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkCustomerCredit(Unknown Source)
: checkCustomerCredit 
[12/11/02 19:49:17:750 EST] 2c5056a8 SystemErr     R org.spec.jappserver.orders.orderent.ejb.ConcreteOrderEnt_ccae7984 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.unsetEntityContext(Unknown Source)
: 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=483501

	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.
