wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes Interview Questions Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Interview Questions Help" Watch "Interview Questions Help" New topic
Author

Interview Questions Help

Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
Hello ,
I am quite new to EJB. I have found interview questions posted here in forum but could not find answers for following questions. If someone know, please help me. Thanks in advance.
1) How many tables can be attached to entity Bean?
2) Why field variables are declared public in entity bean?
3) Which class is implemented in primary key class?
4) How does stateful entity bean stores it's state?
5) Why does stateless session bean does not store its state even though it has ejbActivate and ejbPassivate methods ?
6) If my browser do not support cookie and cookie is sent by the server, what will happen?
7) Can we use user defined threads in EJB? if no then why?


Sandeep
Howard Kushner
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
Hello Rajesh,
You should buy one good EJB book. I one I like best is Richard Monson-Haefel's book "Enterprise JavaBeans", now in its 3rd edition. There are others, of course. See if you can get a used copy, or borrow one from somebody if you can't afford to buy it right away.
Regards,


Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="http://www.amazon.com/exec/obidos/tg/detail/-/1931182108/" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
Let me answer a couple of these...

3) Which class is implemented in primary key class?
This actually is an interface and the answer is serializable.
4) How does stateful entity bean stores it's state?
It stores them in its instance variables
5) Why does stateless session bean does not store its state even though it has ejbActivate and ejbPassivate methods ?
These callbacks are never made by the container for stateless session beans.
6) If my browser do not support cookie and cookie is sent by the server, what will happen?
The session cannot be tracked. You should use URLencoding for this.
7) Can we use user defined threads in EJB? if no then why?
NO. The specs recommend against doing so, because thread management is intended to be an EJB-container feature.
-Sri


UP THE IRONS !
Ramakrishnan thiyagarajan
Ranch Hand

Joined: Oct 07, 2003
Posts: 57
hi rajesh,
in bmp a bean can map many tables.but n cmp only one table
should be mapped.this is the ejb sepc in 1.1. but in ejb2.0 it possible to map more than one table in cmp
Michael Fitzmaurice
Ranch Hand

Joined: Aug 22, 2001
Posts: 168

6) If my browser do not support cookie and cookie is sent by the server, what will happen?
The session cannot be tracked. You should use URLencoding for this.

I think you meant URL rewriting for tracking sessions, rather than encoding. URL encoding is something different.
Michael


"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
Thanks for replies. And Thanks for advices too.
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
4) How does stateful entity bean stores it's state?
It stores them in its instance variables
What is the meaning of stateful entity bean???


Thanks,
Mathews
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Mathews P Srampikal:
4) How does stateful entity bean stores it's state?
It stores them in its instance variables
What is the meaning of stateful entity bean???

There are no "stateless" or "stateful" entity beans, only "entity beans". Or do you mean what's the difference between stateful and stateless session beans?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
Oops,
As soon as I saw stateful I assumed it was session beans. Lasse is ofcourse right - there are no stateful/stateless Entity Beans.
-Sri
Prakash Krishnamurthy
Ranch Hand

Joined: Oct 08, 2002
Posts: 154
Originally posted by Sri Basavanahally:
4) How does stateful Session bean stores it's state?
It stores them in its instance variables

Sri,
Doesnt the container use ejbPassivate() and ejbActivate() and write them out to the disk? I tried to research on your answer, but couldn't find it anywhere. Can you give some reference where you found this, so that I could read about it?
PK
[ October 31, 2003: Message edited by: Prakash Krishnamurthy ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interview Questions Help