• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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 ??


 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic