Why an onMessage call in Message-driven bean is always a seperate transaction?
EJB 2.0 specification: “An onMessage call is always a separate transaction, because there is never a transaction in progress when the method is called.” When a message arrives, it is passed to the Message Driven Bean through the onMessage() method, that is where the business logic goes. Since there is no guarantee when the method is called and when the message will be processed, is the container that is responsible of managing the environment, including transactions.
Related Questions
- If I throw a custom ApplicationException from a business method in Entity bean which is participating in a transaction, would the transaction be rolled back by container?
- My session beans call other bean methods within a transaction. Using bean-managed transactions, how should I take care of commit and rollback ?
- How does a bean access multiple databases in the same transaction?