tags:

views:

204

answers:

0

According to my understanding of the EJB spec both of the remove methods should invoke Bean.ejbRemove() and put the EJB instance back in the EJB pool. This should make the Remote instance (returned from EJBHome.create()) no longer usable.

As far as I can tell ejbRemove is being called but the remote instance is still usable, which implies that the EJB was not put back in the pool.

In the following test we get "Shouldn't get here" rather than "Should get this"...

public void testRemoteEjbInvocation() 
        throws CreateException, RemoteException, RemoveException {

    SF sf = home.create();

    try {
        sf.doStuff();

    } finally {
        home.remove(sf.getHandle());

        try {
            sf.doStuff();
            System.err.println("Shouldn't get here");
        } catch (Throwable e) {
            System.err.println("Should get this:" + e);
        }
    }
}