Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic