• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

ejb access beans and inital context  RSS feed

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have generated ejb access bean for my stateless session bean
I saw the generated code, it does not talk about provider url

How would this access bean run if my ejb client is not in the same server as ejb?

i.e. how can i set the context factory and provider url for this ejb access bean???


ks
 
author & internet detective
Posts: 39283
727
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kalpesh,
Access beans are just shortcuts for convenience. If using a remote server, you need to write your own JNDI lookup.
 
Kalpesh Soni
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Jeanne !

I found this
http://publib.boulder.ibm.com/infocenter/ad51help/index.jsp?topic=/com.ibm.etools.ejb.doc/html/ceaxbn3.htm

It says i should use setInitialContextProviderURL()

but i dont see that method available!

I also looked at abstract bean code that the ejb access bean extends
i.e. com.ibm.ivj.ejb.runtime.AbstractAccessBean

I decompiled it and saw it
it has a pretty complex code
I also see the documentation saying it caches home and remote objects for us

I am not sure if access beans should be used in production env or not

and if they can be used , there must be a standard mechanism to set the provider url

but instead of setInitialContextProviderURL()
i see setInit_NameServiceURLName()

 
Jeanne Boyarsky
author & internet detective
Posts: 39283
727
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kalpesh,
I'm not sure. I find it more convenient to code the JNDI lookup than try to change WSAD's generated code. Mainly because it would get wiped out every time I regenerated.
 
Kalpesh Soni
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from documentation

EJB factory and data class access beans typify the new access bean design found in WebSphere´┐Ż Studio

Setting the context factory and provider URL using EJB factories
Assume that you need to refer to a naming context other than the one referenced by the current System property settings. If you have mapped the no-arg constructor to findByPrimaryKey(), then in the original design, you would use the following code:

In the new design, the same code can be written almost exactly the same way:


 
Have you no shame? Have you no decency? Have you no tiny ad?
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!