Java How to Program, 10/e Multiple Choice Test Bank Page 4 of
5
d. None of the above.
29.3.7 Q3: The JPA annotation @Basic specifies whether the column is optional
and whether the corresponding data should loaded ________ (i.e., only when the
data is accessed through the entity object) or ________ (i.e., loaded immediately
when the entity object is created).
a. lazily, actively
b. slowly, eagerly
c. lazily, eagerly
d. idly, actively
29.5 Address Book: Using JPA and Transactions to
Modify a Database
29.5.1 Transaction Processing
29.5.1 Q1: which of the following statements about JPA database transaction
processing is false?
a. Transaction processing enables a program that interacts with a database to
treat a set of operations as a single operation. Such an operation also is known
as an atomic operation or a transaction.
b. At the end of a transaction, a decision can be made either to commit the
transaction or roll back the transaction.
c. Committing a transaction finalizes the database operation(s); all insertions,
updates and deletions performed as part of the transaction cannot be reversed.
d. Rolling back the transaction leaves the database in its state prior to the data-
base operation. This is useful when a portion of a transaction fails to complete
properly.
29.5.1 Q2: In JPA transaction processing, if the operations execute successfully,
you call EntityTransaction method _______ to commit the changes to the da-
tabase. If any operation fails, you call EntityTransaction method ________ to
return the database to its state prior to the transaction.