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

We select a customer with good credit.

SQL> select c_id from C_customer where c_credit='GC' and c_id < 10;

      C_ID
----------
         2
         3
         4
         5
         6
         7
         8
         9

8 rows selected.

For this test, we have chosen a c_id of 2. Using the web interface, we execute a newOrder transaction of item 00001MITEM00001 in quantity of 5. 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: 1102002
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 1102002 is verified via the o_orders and o_orderline tables.


SQL> select * from O_orders where o_id=1102002;

      O_ID     O_C_ID   O_OL_CNT O_DISCOUNT    O_TOTAL   O_STATUS O_ENTRY_D
---------- ---------- ---------- ---------- ---------- ---------- ---------
O_SHIP_DA
---------
   1102002          2          1          0    2115.97          1 15-NOV-04



SQL> select * from O_orderline where ol_o_id=1102002;

     OL_ID    OL_O_ID OL_I_ID             OL_QTY  OL_STATUS OL_SHIP_D
---------- ---------- --------------- ---------- ---------- ---------
         1    1102002 00001MITEM00001          5

