Bart Laeremans

+ Follow
since Aug 06, 2001
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 Bart Laeremans

The J2EE API seems to be very clear on this.

Interface SessionSynchronization.
The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed.

So I think the beforeCompletion-method will not be called
when the transaction is set to Rollback. All the resources I've
found up till now also point to this answer.

I'm just studying for the exam myself, and I think the
answer is as followed.

The bean should just throw the application exception,
because only system exception would automatically cause
the transaction to rollback.

To roleback a transaction with a application exception
the bean should call setRollbackOnly before throwing
the exception.

You are correct, the total idea would indeed be an integration test.
But what I'm interested in is a good way to test whether my MDB is working.
16 years ago
Hey Guys and Gals,

I'm looking for the best way to test a message-driven bean using JUnit.

My situation:
I've got message-queue on BEA WebLogic which regularly receive messages from a Job scheduled using Quartz.

Now I want to write junit, which uses a Quartz-configuration to schedule a single post to my MDB. But I don't really know what the best way would to test whether my MDB received the message.

Can I get some insides from you guys and gals on the best practises concerning testing of MDB.

Thx in advance,

Yours sincerely

Buckaroo Bart
16 years ago
D is indeed correct.
On some containers a Thread-safe servlet is not be instantiated for every request. A kind of pool will be used so that the same servlet is not used concurrently, but will be reused is the servlet is not in use by another request.
Some containers might create new instances for every request, but the only certainty that U have is that multiple request don't use the same servlet at the same time.
You could also check out
where you will find a basic XML-tutorial.
You'll will find other related tutorials there
as well, like XSL, HTML, JavaScript, ...
The site covers just about everything to do
with web-publications.