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'.

	select min(c_id) from spec/c_customer where c_credit='BC'

        MIN ( C_ID )
           10

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 SPECjAppServer2001 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 43751:

org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.setEntityContext(Ljavax/ejb/EntityContext;)V+0 (OrderCmpEJB.java:420) : found SequenceSesHome interface
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.setEntityContext(Ljavax/ejb/EntityContext;)V+0 (OrderCmpEJB.java:420) : found CustomerEntHome interface
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.setEntityContext(Ljavax/ejb/EntityContext;)V+0 (OrderCmpEJB.java:420) : found LargeOrderSesHome interface
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.setEntityContext(Ljavax/ejb/EntityContext;)V+0 (OrderCmpEJB.java:420) : found ItemEntHome interface
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.setEntityContext(Ljavax/ejb/EntityContext;)V+0 (OrderCmpEJB.java:420) : found OrderLineEntHome interface
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.ejbCreate(I[Lorg/spec/jappserver/orders/helper/ItemQuantity;)Ljava/lang/Integer;+0 (OrderCmpEJB.java:99) : ejbCreate 
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.ejbCreate(I[Lorg/spec/jappserver/orders/helper/ItemQuantity;)Ljava/lang/Integer;+0 (OrderCmpEJB.java:99) : Atomicity Test (1,2,3): Order Id: 43751
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.ejbCreate(I[Lorg/spec/jappserver/orders/helper/ItemQuantity;)Ljava/lang/Integer;+0 (OrderCmpEJB.java:99) : Atomicity Test 3: OrderLineId: 1
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.getPriceWithDiscount(Ljava/lang/String;)D+0 (OrderCmpEJB.java:518) : getPriceWithDiscount 
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.getPercentDiscount(D)D+0 (OrderCmpEJB.java:589) : getPercentDiscount
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.findCustomer()V+0 (OrderCmpEJB.java:536) : findCustomer
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.checkCustomerCredit()V+0 (OrderCmpEJB.java:566) : checkCustomerCredit 
org.spec.jappserver.orders.orderent.ejb.OrderCmpEJB org/spec/jappserver/orders/orderent/ejb/OrderCmpEJB.unsetEntityContext()V+0 (OrderCmpEJB.java:512) : 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.

	select * from spec/o_orderline where ol_o_id=43751

      OL_ID         OL_O_ID   OL_I_ID                 OL_QTY       OL_STATUS   OL_SHIP_DATE
	********  End of data  ********                                                              

	No data selected for output.

Test was successful.
