Cracking the Java Coding Interview pdfdrive com


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

anything”? (EJB)
Answer EJB1.1 does mandate the support of RMI-IIOP. OK, to Answer the
second Question:
There are 2 types of implementations that an EJB Server might provide:
CORBA-based EJB Servers and Proprietry EJB Servers. Both support the RMI-
IIOP API but how that API is implemented is a different story. (NB: By API we
mean the interface provided to the client by the stub or proxy). A CORBA-based
EJB Server actually implements its EJB Objects as CORBA Objects (it therefore
encorporates an ORB and this means that EJB's can be contacted by CORBA
clients (as well as RMI-IIOP clients)
A proprietry EJB still implements the RMI-IIOP API (in the client's stub) but the
underlying protocol can be anything. Therefore your EJB's CANNOT be
contacted by CORBA clients. The difference is that in both cases, your clients
see the same API (hence, your client portability) BUT how the stubs
communicate with the server is different.
Question The EJB specification says that we cannot use Bean Managed
Transaction in Entity Beans. Why? (EJB)
Answer The short, practical Answeris... because it makes your entity beans
useless as a reusable component. Also, transaction management is best left to the
application server - that's what they're there for. It's all about atomic operations
on your data. If an operation updates more than one entity then you want the
whole thing to succeed or the whole thing to fail, nothing in between. If you put
commits in the entity beans then it's very difficult to rollback if an error occurs at
some point late in the operation.
Question Can I invoke Runtime.gc() in an EJB? (EJB)


Answer You shouldn't. What will happen depends on the implementation, but
the call will most likely be ignored. You should leave system level management
like garbage collection for the container to deal with. After all, that's part of the
benefit of using EJBs, you don't have to manage resources yourself.

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   86   87   88   89   90   91   92   93   ...   182




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