Jeroen van der Velden

+ Follow
since Apr 07, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeroen van der Velden

Does anyone know if "Head First Servlets and JSP" will be accompanied with a LearnKey Masterexam. I missed that with "Head First EJB".

Hi Kathy & Bert,

Will "Head First Servlets and JSP" be accompanied with a learnkey masterexam. I missed that with "Head First EJB".

Hi kriti,
I think if you want to prepare for the certification Head First EJB by Bert Bates and Kathy Sierra is a good book to start. If you want to have a more profound knowledge of EJBs you can read Mastering Enterprise JavaBeans (2nd Edition) by Ed Roman, Scott W. Ambler, Tyler Jewell.
Remember that these books are about the EJB 2.0 specification and maybe at your work place they are still using the EJB 1.1 specification.
[ April 24, 2004: Message edited by: Jeroen van der Velden ]
The short, practical answer is ... 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.
Think of an account transfer which takes money from the first account and then pays it into a second account. If the paying in part fails how do you put the money back in the first account? What about if that then fails too?
The transaction should always "wrap" the entire operation. There are two obvious ways of achieving this in an EJB environment:
Use the javax.transaction package
Use a session bean to represent usecases and specify how transactions should be managed as part of the session bean's deployment descriptor.
Solution 2 is the "correct" way to do it. Either way, you can simply leave all transaction code out of your entity beans.
See link for the original message where i copied the answer above from...
I think you will find your answer here:
the WSIF site
They also have a mailinglist.
[ May 07, 2003: Message edited by: Jeroen van der Velden ]
19 years ago
Thanks Bert. Ik just overlooked de topic
In the Java SCJP 1.4 Practice Exam from Whizlabs Question 2 I found this piece of code:

Can anyone tell me wat a static block is? When is it being executed?
[ April 12, 2003: Message edited by: Jeroen van der Velden ]
[ April 12, 2003: Message edited by: Jeroen van der Velden ]
Why can a class within a method only see the final variables of the enclosing method.
Can somebody explain to me why the following code compiles and runs:
double x; x=24.0/0;
The answer says it will compile and run because floating point nummers don't produce a divide-by-zero ArithmeticException. They will give a result which is Not a Number value. But for me it looks like 24.0 is a double and not a floating point number because it has no f attached to it.