What is true about Message-Driven Beans (MDBs)?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
https://docs.oracle.com/javaee/7/tutorial/ejb-intro003.htmlMessage-Driven Beans (MDBs) are a type of Enterprise JavaBeans (EJBs) component in Java EE that allows for asynchronous processing of messages. When a message is sent to a Java Message Service (JMS) queue or topic, an MDB can be configured to listen for messages on that destination and then process them as they arrive.
Now, let's review each of the given options:
A. MDBs can participate in transactions: This is true. MDBs can participate in transactions, which allows them to ensure that their message processing operations are atomic, consistent, isolated, and durable (ACID). This means that if there is a problem during message processing, any changes made to the system can be rolled back to their previous state.
B. MDBs are invoked synchronously: This is false. MDBs are invoked asynchronously, which means that they do not block the calling thread while processing a message. Instead, the message is added to a queue and processed by the MDB when it is available.
C. Each MDB can process messages only from a single client: This is false. MDBs can process messages from multiple clients. However, each MDB instance is typically associated with a single JMS destination (queue or topic) and receives messages only from that destination.
D. MDBs retain data caches between client calls: This is false. MDBs are stateless by default and do not retain any data between message processing operations. Any data that needs to be persisted between message processing operations should be stored in a separate data store, such as a database.
In summary, MDBs are asynchronous components that can participate in transactions and process messages from multiple clients, but do not retain data caches between processing operations.