Atomicity Test Two
------------------

We select a customer with good credit.

SQL> select c_id from c_customer where c_credit = 'GC' and c_id < 20;

      C_ID
----------
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        14
        16
        17
        18
        19

18 rows selected.


For this test, we have chosen a c_id of 12. Using the web interface, 
we execute a newOrder transaction of item 0001MITEM00018 in quantity of 1. 
The order completes succesfully and the application server output shows:

org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext
(Ljavax.ejb.EntityContext;)V(OrderCmp20EJB.java:472): found SequenceSesHome 
interface
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext
(Ljavax.ejb.EntityContext;)V(OrderCmp20EJB.java:480): found CustomerEntHome 
interface
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext
(Ljavax.ejb.EntityContext;)V(OrderCmp20EJB.java:488): found LargeOrderSesHome 
interface
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext
(Ljavax.ejb.EntityContext;)V(OrderCmp20EJB.java:493): found ItemEntHomeLocal 
interface
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS
 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.setEntityContext
(Ljavax.ejb.EntityContext;)V(OrderCmp20EJB.java:498): 
found OrderLineEntHomeLocal interface
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS
 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate
(I[Lorg.spec.jappserver.orders.helper.ItemQuantity;)Ljava.lang.Integer;
(OrderCmp20EJB.java:107): ejbCreate
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS
 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate
(I[Lorg.spec.jappserver.orders.helper.ItemQuantity;)Ljava.lang.Integer;
(OrderCmp20EJB.java:115): Atomicity Test (1,2,3): Order Id: 1359002
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS
 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbPostCreate
(I[Lorg.spec.jappserver.orders.helper.ItemQuantity;)V(OrderCmp20EJB.java:149): 
Atomicity Test 3: OrderLineId: 1
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPriceWithDiscount
(Ljava.lang.String;)D(OrderCmp20EJB.java:520): getPriceWithDiscount
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPercentDiscount
(D)D(OrderCmp20EJB.java:592): getPercentDiscount
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.findCustomer
()V(OrderCmp20EJB.java:540): findCustomer
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkCustomerCredit
()V(OrderCmp20EJB.java:568): checkCustomerCredit
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkForLargeOrders
([Lorg.spec.jappserver.orders.helper.ItemQuantity;)V(OrderCmp20EJB.java:622): 
checkForLargeOrders
org.spec.jappserver.orders.orderent.ejb.OrderEnt_nrczp2__WebLogic_CMP_RDBMS 
at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbStore
()V(OrderCmp20EJB.java:417): ejbStore


Order number is 1359002 is verified via the o_orders and o_orderline tables.

SQL> select * from o_orders where o_id = 1359002;

      O_ID     O_C_ID   O_OL_CNT O_DISCOUNT    O_TOTAL   O_STATUS O_ENTRY_D
---------- ---------- ---------- ---------- ---------- ---------- ---------
O_SHIP_DA
---------
   1359002         12          1         .2     110.82          1 25-AUG-04



SQL> select * from o_orderline where ol_o_id = 1359002;

     OL_ID    OL_O_ID OL_I_ID             OL_QTY  OL_STATUS OL_SHIP_D
---------- ---------- --------------- ---------- ---------- ---------
         1    1359002 00001MITEM00018          1
