geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D. Strauss" <>
Subject Re: Entity bean can not remove itself
Date Mon, 03 Jul 2006 17:42:51 GMT
Hello, Markus

It's just a little bit difficult to understand why you (the user) should
handle the instance of a bean :-/ That's the job of the EJB container
(greetings to the OpenEJB people). Or can you post a scenario where you
definitely need to remove an EJB? Share your idea :P

AFAIK it's not your business to know too much of the EJB container and
its EJB instances :P

Best regards


mahu2425 schrieb:
> Hello,
> has nobody an idea if this migh be a bug or if I'm doing anything wrong? I really need
this feature, that an entity bean can remove itself.
> Could anybody help me?   ;-)
> Best regards,
> Markus
>>  Hi there, 
>>  I have an entity bean (CMP) that uses the TimerService and includes 
>>  the TimedObject interface. When the callback function ejbTimeout(Timer timer) 
>>  on the entity bean is executed, the bean should remove itself. 
>>  My code looks like: 
>>  public void ejbTimeout(Timer timer) {
>>    ejbRemove();
>>  }
>> I inserted a few debug statements and I'm sure that ejbTimeout() is executed. Unfortunally
>> bean will not be removed.
>> Has anybody an idea what's going wrong or if this might be a bug? 
>> I also tried to remove the bean using the remove() method from the remote interface
as well as
>> removing it using the remove() method from the home interface. In both cases an exception
will be 
>> thrown (transaction rolled back, could not remove timer) and the server will be completly
>> (GBean DESTROYED message) and will no longer successfully startup at a restart. So,
calling remove() 
>> seems to be a bad idea, but ejbRemove() doesn't work (the Sun J2EE tutorial says
ejbRemove() should 
>> work).
>> What can I do to let the entity bean remove itself?
>> Greets, Markus
> Benachrichtigung bei E-Mail Empfang! -

View raw message