Cracking the Java Coding Interview pdfdrive com


Question What is the role of serialization in EJB? (EJB)


Download 1.48 Mb.
Pdf ko'rish
bet92/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   88   89   90   91   92   93   94   95   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

Question What is the role of serialization in EJB? (EJB)
Answer A big part of EJB is that it is a framework for underlying RMI: remote
method invocation. You're invoking methods remotely from JVM space 'A' on
objects which are in JVM space 'B' -- possibly running on another machine on
the network. To make this happen, all arguments of each method call must have
their current state plucked out of JVM 'A' memory, flattened into a byte stream
which can be sent over a TCP/IP network connection, and then deserialized for
reincarnation on the other end in JVM 'B' where the actual method call takes
place. If the method has a return value, it is serialized up for streaming back to
JVM A. Thus the requirement that all EJB methods arguments and return values
must be serializable. The easiest way to do this is to make sure all your classes
implement java.io.Serializable.
Question What is EJB QL? (EJB)
Answer EJB QL is a Query Language provided for navigation across a network
of enterprise beans and dependent objects defined by means of container
managed persistence. EJB QL is introduced in the EJB 2.0 specification. The
EJB QL query language defines finder methods for entity beans with container
managed persistenceand is portable across containers and persistence managers.
EJB QL is used for queries of two types of finder methods: Finder methods that
are defined in the home interface of an entity bean and which return entity
objects. Select methods, which are not exposed to the client, but which are used
by the Bean Provider to select persistent values that are maintained by the
Persistence Manager or to select entity objects that are related to the entity bean
on which the query is defined.
Question What is the fastest type of JDBC driver? (JDBC)
Answer JDBC
driver performance will depend on a number of issues: (a) the quality of the
driver code, (b) the size of the driver code, (c) the database server and its load,
(d) network topology,
(e) the number of times your request is translated to a different API. In general,
all things being equal, you can assume that the more your request and response
change hands, the slower it will be. This means that Type 1 and Type 3 drivers
will be slower than Type 2 drivers (the database calls are make at least three
translations versus two), and Type 4 drivers are the fastest (only one translation).


translations versus two), and Type 4 drivers are the fastest (only one translation).

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   88   89   90   91   92   93   94   95   ...   182




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling