• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Interview Questions Help

 
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
 
Sandeep Awasthi
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replies. And Thanks for advices too.
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic