Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

doubt about ejbCreate()

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys,

Got a doubt about a line in HF-EJB book, pg #196

It says: You can't make a JDBC call on connection reference. You can use your connection in ejbCreate()

I checked both confirmed / unconfirmed errata as well, didn't get anything.

Or may be I am confused and not interpretting things correctly. If I can get connection objectinside ejbCreate(), why can't I use it for a JDBC call? It all makes sense. Why can't I initialize some instance variable from database inside ejbCreate() and use it repeatly in different business methods of a stateful bean?

TIA for all the help!
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

EJB Spec. 91

"Accessing resource managers and enterprise beans are not allowed in the session bean methods for which the container does not have a meaningful transaction context or client security context."

In stateless session beans, Bean provider doesn't have any control on ejbCreate method. (i.e) Independent of client.

Micheal.
 
Micheal Jacob
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Above para from Spec applicable for stateful bean also....

Micheal.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic