Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNDI : logical vs physical way

Reply
Thread Tools

JNDI : logical vs physical way

 
 
gk
Guest
Posts: n/a
 
      08-15-2010
I read from a book ....

The logical reference (or alias) java:comp/env/ejb/MyBean is the
recommended approach because you cannot guarantee that the physical
JNDI location ejb/MyBean you specify in your code will be available .
Your code wll break if the physical location is changed

Context ctx = new InitialContext();
Object ref =ctx.lookup("java:comp/env/ejb/MyBean");



My Question:
--------------------

suppose I write my java code this way

Context ctx = new InitialContext();
Object ref =ctx.lookup("ejb/MyBean");// This is physical way


>>>> Your code wll break if the physical location is changed


I don't understand this . what change they are talking about ?
are they talking about if I migrate my code to different server ? but
I can create a JNDI with the name "ejb/MyBean" there also in the Admin
server....so, how come the code will break ?

I don't get the concern here and hence don't understand why logical
reference is important here ?

Could you please tell me a case study where the problem could arise ?
when the code will break ?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DAL is physical mapping and BLL logical? =?Utf-8?B?TWF0dE0=?= ASP .Net 1 12-07-2006 02:38 PM
Physical Addresses VS. Logical Addresses namespace1 C++ 3 11-29-2006 03:07 PM
Confusion regarding logical vs. physical drawings unixzip@yahoo.com Cisco 0 07-18-2005 03:20 PM
why use ENC JNDI (java:comp/env) instead of JNDI name ? Mick Java 2 02-23-2005 12:50 PM
Need Help with Hibernate - "Not binding factory to JNDI, no JNDI name configured" Mike S Java 0 09-16-2004 09:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57