Showing posts with label complete java interview questions. Show all posts
Showing posts with label complete java interview questions. Show all posts

Thursday, January 19, 2012

Java Interview Question and Java Beginner Tutorial - Part 8

Is there a guarantee of uniqueness for entity beans?

There is no such guarantee. The server (or servers) can instantiate as many instances of the same underlying Entity Bean (with the same PK) as it wants. However, each instance is guaranteed to have up-to-date data values, and be transactionally consistent, so uniqueness is not required. This allows the server to scale the system to support multiple threads, multiple concurrent requests, and multiple hosts.

    Java Interview Question and Java Beginner Tutorial - Part 6

    Can an EJB send asynchronous notifications to its clients?

     Asynchronous notification is a known hole in the first versions of the EJB spec. The recommended solution to this is to use JMS, which is becoming available in J2EE-compliant servers. The other option, of course, is to use client-side threads and polling. This is not an ideal solution, but it’s workable for many scenarios.

      Java Interview Question and Java Beginner Tutorial - Part 2

      Is it possible to write two EJB’s that share the same Remote and Home interfaces, and have different bean classes? if so, what are the advantages/disadvantages?

      It’s certainly possible. In fact, there’s an example that ships with the Inprise Application Server of an Account interface with separate implementations for CheckingAccount and SavingsAccount, one of which was CMP and one of which was BMP.

        Are enterprise beans allowed to use Thread.sleep()?

        Java Interview Question and Java Tutorial - Part 1

        Are enterprise beans allowed to use Thread.sleep()?

         Enterprise beans make use of the services provided by the EJB container, such as life-cycle management. To avoid conflicts with these services, enterprise beans are restricted from performing certain operations: Managing or synchronizing threads