• 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

remove() is not removing the record from the database

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

I have a code here for Entity bean client



I am trying to call remove at the last line but it is not removing the actual record from the database.
even if I see on the console of weblogic i found that ejbRemove is not called.

I have tried calling remove on the home i.e. remove(new Integer(1)) where 1 is the primary key but then too it is not resulting in database record to be deleted and as well as no ejbRemove is called.

Where as on line 4 of the code i am changing the name and on 5 i am getting the changed name..i got the changed record but only the last line is not working properly as spec says.
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rakesh,

In order to remove an entity from the db you should call EntityManager.remove(Entity bean) or if you create a native query and execute it. Your BankComponent.remove() method what does it contain? Does the client and the bean belong to an enterprise application or the client bean is connecting to EJB container remotely?

Regars,
Nicolas
 
rakesh kadulkar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note :- I am using BMP of EJB 2.0
But specification says that if I call remove on the component interface for an entity bean it will delete the record from the database.

Even if I call remove() method on the component interface i.e. on the EJBObject,
ejbRemove() does not get called and no database record is deleted.

Do I have to put the delete sql statement in the ejbRemove() but even if I place the delete sql statement in the ejbRemove(), this method is also not getting called when I call the remove method on the component interface.


I have even tried calling remove method on the home inteface that takes primary key object as an argument but it is still not working
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic