EJB Interview Questions and Answers For Freshers Part-4
31.How EJB implements dependency injection?
EJB 3.0 specification provides annotations which can be applied on fields or setter methods to inject dependencies. EJB Container uses the global JNDI registry to locate the dependency.
32.What is an EJB Interceptor?
EJB 3.0 provides specification to intercept business methods calls using methods annotated with @AroundInvoke annotation. An interceptor method is called by ejbContainer before business method call it is intercepting.
33.What is class level interceptor in EJB?
Class level interceptor is invoked for every method of the bean. Class level interceptor can be applied both by annotation or via xml(ejb-jar.xml).
34.What is default interceptor in EJB?
Default interceptor is invoked for every bean within deployment.Default interceptor can be applied only via xml (ejb-jar.xml).
35.What is method level interceptor in EJB?
Method level interceptor is invoked for a particular method of the bean. Method level interceptor can be applied both by annotation of via xml(ejb-jar.xml).
36.Explain @Embeddable annotation.
EJB 3.0 provides option to embed JAVA POJO (Plain Old Java Object) into an entity bean and allows to map column names with the methods of the embedded POJO class. A java POJO to be embedded must be annotated as @Embeddable.
37.Explain @Lob annotation.
EJB 3.0 provides support for Blob and Clob types using @Lob annotation.
38.Which types of java classes can be mapped using @Lob annotation?
Following java types can be mapped using @Lob annotation:
39.What is a transaction?
A transaction is a single unit of work items which follows the ACID properties. ACID stands for Atomic, Consistent,Isolated and Durable.
40.What ACID stands for?
ACID stands for Atomic, Consistent,Isolated and Durable.