• 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

question 2 HF page 627

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could somebody explain what is the meaning of: "Environment entries can be unique for instances of the same enterprise bean type"

Miki
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
All the EJB instances from the same home share the same env-entries. That means "Environment entries can be unique for instances of the same enterprise bean type". If you deploy the same EJB twice then you can have different environment entries for these two ejbs but all the ejb instances from a home will share the same env entries.


hope that helps.
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then why is the answer for that "not true" in HF.

Miki
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Environment entries can be unique for instances of the same enterprise bean type



Hey its tricky. No env entries can;t be unique for the same instances of same EJB. If this was correct that it would mean that all the instances can have different env entries which is not correct.

I read this question twice to understand it.
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't understnand. What is ment by environment entries? The env entry key (jndi) or value? I read couple of times but still ... I don't understand what he/she wants to say.

Miki
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I still don't understnand. What is ment by environment entries? The env entry key (jndi) or value?



Its about value.

Ok will try to help you understand.

Suppose we have env entry define as

<ejb-jar>

<enterprise-beans>

<session>
<ejb-name>MyEJB</ejb-name>
<home>MyHome</home>
<remote></remote>
<ejb-class></ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>rate</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>10</env-entry-value>
</env-entry>
</session>


Now all the instance of MYEJB can acces the rate env entry value and they will get the value as 10{which means its not unique for each instance}. Suppose there are 5 instances of MyEJB all these instances when access the rate variable they will get value as 10 only.

The question says

Environment entries can be unique for instances of the same enterprise bean type.

Whic is not correct as its can't be unique rather it can be unique for different EJB or for the same EJB deployed multiple times. The main point is all ejb instances from the same home will share the same env entry values.

sawan
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sawan,

As far I know env entries are on home and not on bean instance and the scope of env-entries is within the <ejb-name> in which it is declared.I think the env-entries are unique for home.

Am I rite?

Regards
Shiv
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shiv ,
Yes you are right. This is what I wrote in my previous post

"The main point is all ejb instances from the same home will share the same env entry values."
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sawan, after studying your post I finally got the idea :-). I am definately not native english speaker but I find the formulation at least very strange! Why could't she just say: "Environment entries of the same enterprise bean type can have distinct values" instead of .. "be unique for instances"..

Thanks,

Miki
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sawan parihar

Thanks you very much, I learned a lot from your explaination. I assume you are all correct on this issue, but I got a different conclusion.

1) "Environment entries can be unique for instances of the same enterprise bean type"
2) "Environment entries can be not unique for instances of the same enterprise bean type"

These above 2 statements are both true, since "can be unique" also means "can be not unique". That is why people get confused.

a) Environment entries are always unique for instances of the same enterprise bean type.
b) Environment entries are always the same for instances of the same enterprise bean type.

The answers for both a) and b) should be false.

I just started to prepare this test. Correct me if I am wrong!
Thanks in Advance!
[ June 27, 2005: Message edited by: Roseanne Zhang ]
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Miki Muzsi
My guess is you don't have English problems on this question, but the author has English or Formal Logic problems.

Correct me if I am wrong!
Thanks in Advance!
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Roseanne ,

1) "Environment entries can be unique for instances of the same enterprise bean type"
2) "Environment entries can not be unique for instances of the same enterprise bean type"



Point first is not correct. In this case we are talking about individual instances of the same ejb and are saying that the environment entries will be unique{means each will get its own env entry values} which is not correct.

Point 2nd is correct.

a) Environment entries are always unique for instances of the same enterprise bean type.
b) Environment entries are always the same for instances of the same enterprise bean type.



In this point b is correct.



My guess is you don't have English problems on this question, but the author has English or Formal Logic problems




When I read this question first I was myself confused but then I realised that its not the question that is wrong . Rather I read it twice and I got it. The question statement is
"Environment entries can be unique for instances of the same enterprise bean type". Now this question appears straight and simple to me.

Anyways the good thing is we are able to answer it correctly.

Thanks.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"can not be unique" is not the same as "can be not unique".

I think you altered my statement, and it is not quote of mine.

However, your answer is correct, I understand now. Thanks!
[ June 27, 2005: Message edited by: Roseanne Zhang ]
 
please buy my thing and then I'll have more money:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic