geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D. Strauss" <geron...@ds-2.de>
Subject Re: Entity bean can not remove itself
Date Tue, 11 Jul 2006 05:56:01 GMT
Hello, Markus

try this:

Way a (the Collection way):
java.util.Collection<EjbLocal> c=ejbHome.findAll();
EjbLocal delBean=null;
for(EjbLocal l : c){
	//find the bean you want to remove: for now, find the last one
	delBean=l;
}
c.remove(delBean);

Way b (the usual way):
EjbLocal delBean=ejbHome.findByPrimaryKey(12);
delBean.remove();

Best regards

Dirk

mahu2425 schrieb:
> Hello Dirk,
> 
> I'm not sure what you mean by "collection version of ejbRemove()".
> 
> Could you please explain it a little bit more?
> 
> 
> Thank in advance,
> 
> Markus
> 
> 
> 
> 
>> Hello, Markus
>>
>> now I get it ^^ (at least I think so)
>>
>> So, to summarize it: you work with a CMP bean that is used by various
>> other beans (JMS in particular). After all things have been done I want
>> to remove the bean?
>>
>> Using ejbRemove() is OK but you may want to use the Collection version
>> of ejbRemove. I think (if I remember correctly) that ejbRemove() always
>> crashed the EJB container. So I used the collection method. It is a
>> little bit difficult but it worked.
>>
>> Give it a try and tell us if it works.
>>
>> Best regards
>>
>> Dirk
> 
> Schnell und einfach ohne Anschlusswechsel zur Lycos DSL Flatrate wechseln und 3 Monate
kostenlos ab effektiven 5,21 EUR pro Monat im ersten Jahr surfen.
> http://www.lycos.de/startseite/online/dsl/index.html?prod=DSL&trackingID=email_footertxt

Mime
View raw message