• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

remove() is not removing the record from the database

Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
  • Quote
  • Report post to moderator

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?

rakesh kadulkar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • 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
He does not suffer fools gladly. But this tiny ad does:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic