Exam MCIA - Level 1 All QuestionsBrowse all questions from this exam
Question 5

A Mule application is being designed to do the following:

Step 1: Read a SalesOrder message from a JMS queue, where each SalesOrder consists of a header and a list of SalesOrderLineltems.

Step 2: Insert the SalesOrder header and each SalesOrderLineItem into different tables in an RDBMS.

Step 3: Insert the SalesOrder header and the sum of the prices of all its SalesOrderLineltems into a table in a different RDBMS.

No SalesOrder message can be lost and the consistency of all SalesOrder-related information in both RDBMSs must be ensured at all times.

What design choice (including choice of transactions) and order of steps addresses these requirements?

    Correct Answer: C

    To ensure that no SalesOrder message is lost and that the consistency of all SalesOrder-related information in both RDBMSs is maintained, an XA transaction is necessary. First, read the JMS message in an XA transaction. In the same XA transaction, perform both database inserts, and do not acknowledge the JMS message until the transaction is complete. If any part of this transaction fails, the entire transaction will roll back, ensuring that the JMS message is not lost and data consistency is maintained.

Discussion
GrumpOption: C

C I think.. XA Transaction is a two phase commit. As long as the DB Driver and JMS drivers support two phase commit, it will provide enough gurantee of consistency. If either DB Transaction fails, whole transaction will fail causing JMS message to go back in the queue. If XA transaction for a particular JMS message fails X number of times, it will end up in DLQ.

Pavan_NagineniOption: D

D. 1. Read the JMS message (NOT in an XA transaction) 2. Perform BOTH DB inserts in ONE DB transaction 3. Acknowledge the JMS message This feels to be okay ; Anyway I feel they are intended to be XA only when they mean in ONE transaction Others are not because ; You can leave JMS not to acknoledge the message; You can not maintain consistency in 2 individual transactions ; Reading/acknowledging and doing XA is also okay But you do not want to aknowledge before you are done is the point for not selecting this.

siva_intOption: D

Is it C or D. I feel it is D

gilofernandesOption: C

All operations must be performed in the same XA transaction to guarantee consistency across the DB's. No ack otherwise in case of failure message is deleted from the JMS queue.

abidfrqOption: C

As main thing is we should not lose any data, so will apply transaction, as here JMS and DB involved we will use XA transaction and XA would include JMS and both DB and the we will acklowndege message after XA transaction, this ensure successful operation. So C would be the right answer.

Mj290511Option: C

C, as both the transactions need to be updated

ThomasTheTankOption: C

I think it's C. Definitely, C works with 2-way commit with XA transaction. If D works, D would be the most efficient answer, but it says "2. Perform BOTH DB inserts in ONE DB transaction"... it can't be local transaction if you want to insert records into different RDBSs with one transaction... it has to be "XA transaction", so D is wrong. Thus, C is the answer.

Viv2005Option: C

You cannot keep the read JMS message out of the transaction because if one of the DB inserts fails, the message will NOT roll back to the queue and will be lost. Correct answer is C, because the default ack mode is AUTO which will acknowledge only when the flow is successful else not. XA transaction initiated/begins from JMS message read and 2 DB inserts will participate in the transaction. Remember to set XA in the configuration of both DB connectors.

1MKOption: C

C coz 2 way commit

sanni27Option: C

Should be C