• 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

Some basic EJB help needed...

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all!

I know java, jsp and servlets, but I would like to use session and entity beans in my app. Where should I put the code that uses the bean?

(yes...code snippets are helpful )

thanks
Andr�
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andre

I'm also a bit of a beginner in this areas, but you'll want to invoke your session bean somewhere in your client application. From the brief description of the architecture you describe, probably you'll call the session interfaces from a servlet, although you may want to consider creating a facade to the EJB layer, and having your servlet call the facade (which in turn invokes the bean). (If you were using the struts framework, you'd call the bean/facade from the relevant Action class).

Take some time to consider wether your client application (the WAR) will run inside the same JVM as the EJB jar- if so, you may want to invoke the session bean using the 'local' & 'local home' interfaces as opposed to the 'remote' & 'remote home' interfaces. Can't give you any advice on entity beans as I rarely use them.

I found the jndi bindings for the local interfaces to be a pain in the arse - you can find my sorry tale over on the IBM/Websphere board, including some code snippets:

local bean invocation

Hope this helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic