The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by talicea]

I just need a clarification: Table 2.4 text says both that persistence needs
to be fine-grained and that persistence should not be fine-grained.

Also, where's the ERRATA page?
import-bot (20211) [Avatar] Offline
#2
Re: Table 2.4
[Originally posted by plinskey]

> I just need a clarification: Table 2.4 text says both that persistence needs
> to be fine-grained and that persistence should not be fine-grained.

Hmm, I guess we weren't as clear as we should have been.

The point of that table is to list the various services provided by the EJB
specification, and the granularity that those services are typically used at.
So, persistence is typically something that you want to use in a fine-grained
manner relative to the other three services listed (typically, you'll want to
perform many persistence operations in the course of a transaction, for
example). However, because the EJB specification couples these four services
together, you're left in an inconvenient position in which you end up paying a
penalty -- your fine-grained persistence needs end up causing undue overhead
and architectural compromises.

So, in short, you do want persistence to be fine-grained, but the EJB spec
doesn't allow separation of the different services (except when using EJB2
local interfaces to separate out remote access). Since the other services (the
ones that EJB was designed for in the first place) are coarse-grained in
nature, many of the compromises that are OK for coarse-grained services get
unnecessarily forced on the persistence problem.

-Patrick