• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

ejbLoad is not getting called

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

I am trying out the Entity Bean Example with BMP from Mastering EJB...3rd Edition

This is my client code


It prints null is all 4 cases....
There is no other error while deploying the bean or running the client code.
Also I have put a print statement within each bean method ...
I see that ejbLoad is not getting called at all....but ejbStore is.
I am using JBoss....
What could be the reason for this?
 
Pradeep Bhat
Ranch Hand
Posts: 31
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is my bean code....

 
Pradeep Bhat
Ranch Hand
Posts: 31
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actually the problem is that even though EJBStore is called, the database entry is not updated. The return value of preparedStatement.executeUpdate() is 0.
That is because the bean's 'accountId' attribute is not getting populated.

Also consider the client code :



acc.getAccountId() is displayed as null. But other attributed are populated.
Any idea why this happens ??


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic