I spoke about it two days ago with Bill and I think we have different
problems with remove methods.
Take the home.remove call on EB: This is transformed in a remote.remove call
*inside* the client proxy (trick)! This has two problems:
- anyone implementing server side interceptors won't be able to intercept
this call has a home invocation and will not be able to differentiate
home.remove calls from remote.remote calls.
- when the pk no more exists, home.remove(pk) should simply raise an
NoSuchObjectException. That is absolutely not the case right now. Right now:
- the transaction is rollbacked!!!
- the excetpion is wrapped in a TransactionRollbackedException!
to test this behaviour, simply add something like this for a test:
myHome.remove (1);
myHome.remove (1);
Depending if a bean with pk=1 existed, either the first or the second call
will abruptly fail.
I've seen that no test covers this case in the testsuite.
IMHO, the client proxy shouldn't reinterpret the home.remove(pk) in
remote.remove().
Cheers,
Sacha
> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]De la part de
> Scott M Stark
> Envoy� : jeudi, 23 mai 2002 08:57
> � : [EMAIL PROTECTED]
> Objet : Re: [JBoss-dev] EJBObject.remove() on a removed SFSB
>
>
> There should be a java.rmi.NoSuchObjectException:
> <ejb-2.0-spec, page 79>
> When the client calls remove on the home or component interface to remove
> the session
> object, the container issues ejbRemove() on the bean instance.
> This ends the
> life of the session
> bean instance and the associated session object. Any subsequent attempt by
> its client to
> invoke the session object causes the java.rmi.NoSuchObjectException to be
> thrown
> if the client is a remote client, or the
> javax.ejb.NoSuchObjectLocalException if
> the client is a local client. (The java.rmi.NoSuchObjectException is a
> subclass of
> the java.rmi.RemoteException; the javax.ejb.NoSuchObjectLocalException
> is a subclass of the javax.ejb.EJBException). The ejbRemove() method
> cannot be called when the instance is participating in a transaction. An
> attempt to remove a
> session object while the object is in a transaction will cause
> the container
> to throw the
> javax.ejb.RemoveException to the client. Note that a container can also
> invoke the
> ejbRemove() method on the instance without a client call to remove the
> session object
> after the lifetime of the EJB object has expired.
> <ejb-2.0-spec>
> xxxxxxxxxxxxxxxxxxxxxxxx
> Scott Stark
> Chief Technology Officer
> JBoss Group, LLC
> xxxxxxxxxxxxxxxxxxxxxxxx
> ----- Original Message -----
> From: "Jason Dillon" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, May 21, 2002 7:35 PM
> Subject: [JBoss-dev] EJBObject.remove() on a removed SFSB
>
>
> Should calling EJBObject.remove() on a SFSB which has been removed already
> throw an exception or should the request be silently ignored?
>
> I was running into a problem which was due to one of my
> finializers removing
> a
> SFSB, which I had previously removed and forgot to null. Currently when
> this
> happens an erronious activation exception is thrown, since there
> is no state
> file for the bean (having been removed already).
>
> I think it would be a good idea to throw a meaningful exception in
> StatefulSessionContainer.remove() to indicate the illegal state... unless
> the
> spec says we should ignore this. I have not checked the spec.
> The Javadoc
> for EJBObject.remove() does not provide any insight either.
>
> Does anyone know what the behavior should be, exception or non-exception?
> And
> if it is an exception what flavor?
>
> --jason
>
>
>
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development