Re: EJB Transaction
On 15.08.2010 16:17, Arved Sandstrom wrote:
Lew wrote:
gk wrote:
This is from Book "Ejb 3.0 In Simple Steps" By Drearntech Press
[ SNIP ]
MANDATORY
----------------------------
We should use the MANDATORY attribute when our method needs to verify
that the component was invoked within the context of a client-managed
transaction.
My Question>> : Again, "method needs to verify that the component
was invoked within the context of a client-managed transaction" is
NOT quite understandable . What is to be written for this
verification in code level ? may be in terms of code or a case study
to understand this concept.
What a terrible book.
<http://www.java-tips.org/java-ee-tips/enterprise-java-beans/introduction-to-the-java-transactio.html>
(found after two minutes with Google - have you tried that?)
explains it better. So does (gasp!) the official Java EE tutorial,
of all things:
<http://download.oracle.com/javaee/6/tutorial/doc/bncih.html> in
particular,
<http://download.oracle.com/javaee/6/tutorial/doc/bncij.html#bncik>
The difference is that REQUIRED asks the container to start a
transaction if there isn't one, MANDATORY throws an exception if
there isn't one.
The main problem with a lot of programming books is that they are
unnecessary. As you pointed out, the OP hasn't asked any questions in this
thread that aren't answered (and answered well) by some of the commonly-used
online references. A lot of books cover the same ground - *at the same
level* - as these online tutorials; their authors really don't have much if
anything useful to add, so in desperation they reword the original
material...usually mangling the sense of it.
I couldn't agree more.
The main recommendation I'd make is always start with the (semi-)official
online references. Given reasonable Google fu the "accepted" references for
a majority of programming problems, and for no small percentage of software
engineering issues, appear on the first few pages of Google results. It can
sometimes be useful to ask on a NG such as this whether a found link
actually is a good one.
Adding to that: In the case of Java technologies I have found Sun
specifications to be very readable while not being overly lengthy
(compared to some other stuff published by some official committee). I
would consider those specs better points of reference than the types of
books you mention even though in the case of JEE it can be a bit
difficult to find the right specification to look into just because
there are so many of them. :-)
I'm not knocking software development books - I happen to have a few myself.
:-) However not a single one of them purchased in the last 5 years has had
anything to do directly with J2EE/Java EE. I've got no books on any of that
except for a creaky edition of Java Servlets that's about 8 years old. Yet
well over half of my bread and butter work is J2EE/Java EE, and I sure don't
have everything I need to know in my head. There simply is very little need,
for any level of developer, for servlet or web service or EJB books. I can
look back and recognize that when I was still thinking I needed those kinds
of books that many of them did me a disservice.
As an aside, sometimes I'd like to ask the author of an API and of an
implementation for that API why they then felt the need to write an O'Reilly
or Wrox book on that API - does their official API documentation (and other
related documentation like specifications)suck so bad then? They must think
so.
I would rather assume that there is just a market for such books, i.e.
there are enough people that will buy the book "from the author of X"
much the same as there are enough people to jump on the next buzzword
hype. There is also the sort of people who seem to feel more
comfortably having a book about a topic sitting on their shelve instead
of resorting to a collection of links, PDF's or search engines. I
believe they think they can then tell themselves "I have all knowledge
about Y at my hands".
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/