Name of the team on GitHub Classroom:
Team Member Contributions:
Member 1
| Details | Comment |
|---|---|
| Student ID: | |
| Name: | |
| What part of the lab did you personally contribute to, and what did you learn from it? |
Member 2
| Details | Comment |
|---|---|
| Student ID: | |
| Name: | |
| What part of the lab did you personally contribute to, and what did you learn from it? |
Member 3
| Details | Comment |
|---|---|
| Student ID: | |
| Name: | |
| What part of the lab did you personally contribute to, and what did you learn from it? |
The management of the organization (Siwaka Dishes) has made a decision to allow customers to make purchases on credit. This means that the cash tendered does not have to be the full amount of the order. Customers can make a partial payment, and the remaining amount will be paid later.
- Edit the frontend interface to accept the amount of cash tendered as input to be
sent to the backend through the API endpoint (
/api/meal_order_transaction). - Edit the backend to accept the partial payment for the order through the same
API endpoint, i.e.,
/api/meal_order_transaction, and then insert it into thepaymenttable in the database system. - Create an API endpoint that uses the ORM to
GETall orders that have not been paid in full as well as the total amount of cash tendered, and the remaining balance. - Using the MySQL database system, simulate the termination of
Transaction 2that is waiting forTransaction 1to commit and release the write locks it has acquired. Hint: Transaction 1 should be executed using the SQL code in MySQL_SampleDatabaseTransaction_siwaka_dishes.sql and Transaction 2 should be executed using the frontend in meal_order_transaction.html. - Identify the transaction (
trx_id) ofTransaction 1which is unable toCOMMIT. Re-attempt to executeTransaction 2after the simulation and, just before it is terminated automatically by the database system, KILLTransaction 1manually to allowTransaction 2to complete successfully.
Make use of the following code for Step 4 and Step 5:
- To list all the running transactions:
SELECT * FROM information_schema.innodb_trx;- To identify the
Process ID(processlist_id) of each running transaction:
SELECT t.trx_id, t.trx_mysql_thread_id AS processlist_id, p.USER, p.HOST, p.DB, p.COMMAND, p.TIME, p.STATE, p.INFO
FROM information_schema.innodb_trx t
JOIN information_schema.processlist p
ON t.trx_mysql_thread_id = p.ID;- To terminate the process running the transaction that is not committing:
KILL <processlist_id>;Submit the link to a short video (not more than 4 minutes) demonstrating your lab submission.
| Key | Value |
|---|---|
| Link to the video: | |
| Link to the hosted application: |