Browse Today's favorites or All time favorites.
Please Sign In or Register to share and submit your questions.
Java Queries
Complete java interview questions library
What are transactional attributes?
EJB transactions are a set of mechanisms and concepts, which insures the integrity and consistency of the database when multiple clients try to read/update the database simultaneously.
Transaction attributes are defined at different levels like EJB (or class), a method within a class or segment of a code within a method. The attributes specified for a particular method take precedence over the attributes specified for a particular EJB (or class). Transaction attributes are specified declaratively through EJB deployment descriptors. Unless there is any compelling reason, the declarative approach is recommended over programmatic approach where all the transactions are handled programmatically. With the declarative approach, the EJB container will handle the transactions.
Required: Methods executed within a transaction. If client provides a transaction, it is used. If not, a new transaction is
generated. Commit at end of method that started the transaction. Which means a method that has Required
attribute set, but was called when the transaction has already started will not commit at the method
completion. Well suited for EJB session beans.
Mandatory: Client of this EJB must create a transaction in which this method operates, otherwise an error will be
reported. Well-suited for entity beans.
RequiresNew: Methods executed within a transaction. If client provides a transaction, it is suspended. If not a new
transaction is generated, regardless. Commit at end of method.
Supports: Transactions are optional.
NotSupported: Transactions are not supported. If provided, ignored.
Never: Code in the EJB responsible for explicit transaction control.
Questions to Ask in an Interview
Remember to ask questions that are relevant to the company and position for which you are interviewing.
- What are some of the common characteristics of employees that excel in this environment?
- Would you please comment on your style of management and the reporting structure?
- What is yo
Write a comment