Is it legal to have static initializer blocks in EJB?
Submitted by: AdministratorAlthough technically it is legal, static initializer blocks are used to execute some piece of code before executing any constructor or method while instantiating a class. Static initializer blocks are also typically used to initialize static fields - which may be illegal in EJB if they are read/write - In EJB this can be achieved by including the code in either the ejbCreate(), setSessionContext() or setEntityContext() methods.
Submitted by: Administrator
Submitted by: Administrator
Read Online Java EJB Programming Job Interview Questions And Answers
Top Java EJB Programming Questions
☺ | What is EJB? |
☺ | What happens if remove( ) is never invoked on a session bean? |
☺ | Is it possible to stop the execution of a method before completion in a SessionBean? |
☺ | What is the advantage of using Entity bean for database operations, over directly using JDBC API to do database operations? When would I use one over the other? |
☺ | What is EJB QL? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |