
Atomicity Test #1
=================

Select a customer with BAD CREDIT:



SQL> select c_id from c_customer where c_credit = 'BC' and c_id < 100;

      C_ID
----------
        14
        24
        34
        54
        60
        71
        82
        93

8 rows selected.

For this test customer with C_ID of 14 was selected.A New Order Transaction was
executed using the Web Interface. The New Order Transaction failed with an
Insufficient Credit Exception.

The following is the output from OC4J log:

03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(OrderCmp20EJB.java:107): ejbCreate
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbCreate(OrderCmp20EJB.java:115): Atomicity Test (1,2,3): Order Id: 2111254
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbPostCreate(OrderCmp20EJB.java:149): Atomicity Test 3: OrderLineId: 1
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPriceWithDiscount(OrderCmp20EJB.java:520): getPriceWithDiscount
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.getPercentDiscount(OrderCmp20EJB.java:592): getPercentDiscount
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.findCustomer(OrderCmp20EJB.java:540): findCustomer
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.checkCustomerCredit(OrderCmp20EJB.java:568): checkCustomerCredit
03/09/30 17:57:02 OrderCmp20EJB_PersistenceManager16 at org.spec.jappserver.orders.orderent.ejb.OrderCmp20EJB.ejbPassivate(OrderCmp20EJB.java:397): ejbPassivate 

The Order ID from the above output is: 2111254. Querying this
Order ID from the Database gives:


SQL> select * from O_orders where o_id = 2111254;

no rows selected

SQL> select * from O_orderline where ol_o_id = 2111254;

no rows selected

