*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes To Paul : Question about Queue In MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "To Paul : Question about Queue In MDB" Watch "To Paul : Question about Queue In MDB" New topic
Author

To Paul : Question about Queue In MDB

Mahara J
Greenhorn

Joined: Aug 06, 2005
Posts: 7
Hi !
I am following SCBCD- exam study Kit. In MDB chapter- review question no.8

Which of the following are true statements about an MDB associated with a Queue ?
a) Only one instance from the pool of an MDB type can process a message at a given time.
b) Multiple instances from the pool of an MDB type can process messages at the same time.
c) One instance can handle only one message at a time.
d) A message will go to only one bean instance.

ANSWER: B,C,D

Paul,you have given nice explanation for this answer .
As a amateur in MDB, i can't get it. Can you please explain this with some example.

Thanks,
Jo.
Kay Ra
Ranch Hand

Joined: May 03, 2005
Posts: 80
I think the answer is ACD I don't agree with B.
multiple instances of an MBD type should not get the msg.
The expannation for this can be illustrated by this example.
Let is say we have a msg on receipt on it we need to update a db.So if we have tied it to a queue so only one instance of that msg bean from the pool should get it and act upon it, in this case updating the dtabase.
Secondly if you are associating with a topic. then there are multiple msgbeans type listening. So only one instance of each type will act upon the mss eg. 1 instance from MsgBeanType1 its home MSgBeanType1Home and 1 instance from MsgBeanType2 its home being MsgBeanType2Home.

kay
SCWCD
SCBCD
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
The EJB container is multithreaded. For pooled beans, each request (or message if we are talking about MDBs) is typically run in a separate thread. Multiple messages will be processed concurrently by pulling the necessary number of beans from the pool. So, B is correct.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Vinh Hoang
Greenhorn

Joined: Jun 29, 2005
Posts: 22
This book has an online support at
http://www.manning.com/sanghera
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"Jo"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Thomas Vezhambacheril
Greenhorn

Joined: Aug 02, 2005
Posts: 17
I also think ACD is correct.

Queue means one instance can processes a message at a time. isn't it ?

Thomas
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
a) Only one instance from the pool of an MDB type can process a message at a given time.
b) Multiple instances from the pool of an MDB type can process messages at the same time.



B.. is okay, because, if 2 messages are received, then 2 mdbs will handle it. Remember that there can be more than one source of message. So for example, at an instant, 2 messages for same MDB type can arrive, and so 2 MDBs will handle it.


A.. is wrong as it is stating a general statement that, "in the entire pool, at any instant, at most, one and only 1 MDB is actively processing something". This is wrong as there can be 2 MDBs from the same pool that are active at a certain moment.
Mahara J
Greenhorn

Joined: Aug 06, 2005
Posts: 7
Hello Mark ,
I don't know about Naming policy.This is my real name.But for Last name i added initial.Is it ok?
Thanks for the notification.
Jo
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: To Paul : Question about Queue In MDB
 
Similar Threads
What is real life use of MDB EJB
MDB Question
287 Pre-assessment test questions - Please answer
Weblogic 7.0 certification mock test question
A question about clustering and jms