Cracking the Java Coding Interview pdfdrive com


Download 1.48 Mb.
Pdf ko'rish
bet86/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   82   83   84   85   86   87   88   89   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

Is it possible? (EJB)
Answer Specify the transaction attribute of the bean as RequiresNew. Then as
per section 11.6.2.4 of the EJB v 1.1 spec EJB container automatically starts a
new transaction before the method call. The container also performs the commit
protocol before the method result is sent to the client.
Question I am developing a BMP Entity bean. I have noticed that whenever
the create method is invoked, the ejbLoad() and the ejbStore() methods are
also invoked. I feel that once my database insert is done, having to do a
select and update SQL queries is major overhead. is this behavior typical of
all EJB containers? Is there any way to suppress these invocations? (EJB)
Answer This is the default behaviour for EJB. The specification states that
ejbLoad() will be called before every transaction and ejbStore() after every
transaction. Each Vendor has optimizations, which are proprietary for this
scenario.
Question Can an EJB send asynchronous notifications to its clients? (EJB)
Answer 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.


Question How can I access EJB from ASP? (EJB)
Answer You can use the Java 2 Platform, Enterprise Edition Client Access
Services (J2EETM CAS) COM Bridge 1.0, currently downloadable from
http://developer.java.sun.com/developer/earlyAccess/j2eecas/
Question Is there a guarantee of uniqueness for entity beans? (EJB)
Answer 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.

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   82   83   84   85   86   87   88   89   ...   182




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