How to call ejbRemove after bean crashes? - Weblogic

This is a discussion on How to call ejbRemove after bean crashes? - Weblogic ; Hi, I would like to learn how to do it right: I have an entity bean. Due to an error it crashed (RuntimeException that got encapsulated in an EJBException). The caller of the bean did not recognize the crash (how ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to call ejbRemove after bean crashes?

  1. How to call ejbRemove after bean crashes?

    Hi,

    I would like to learn how to do it right:
    I have an entity bean. Due to an error it crashed (RuntimeException that
    got encapsulated in an EJBException).
    The caller of the bean did not recognize the crash (how could he?) and
    called ejbRemove on its local interface of the entity bean.
    But now ejbRemove got invoked on another (not initialized) instance of
    the entity bean and therefore ended up in another RuntimeException, the
    ressources of the entity bean were not cleaned up and the entity bean
    was not removed.

    Can I recognize from the local interface, if the bean instance in behind
    was exchanged?
    (I did by adding a toString() method in the local interface, but I would
    like to know about a standard J2EE-way ;-)
    Or do I really need to compare toString() output of the local interface
    to recognize that the bean was exchanged? This sounds bad, because it
    could have been exchanged in a regular manner by passivating and
    reactivating it.

    Best regards from snowy Black Forest,
    Mattin
    ---
    Martin Heitz
    Distributed Network Accounting Team

    Elsag Solutions AG
    Roggenbachstr. 1
    D-78050 Villingen-Schwenningen
    Germany
    http://www.elsag-solutions.com
    Tel: +49-(0)7721-9175-595
    Fax: +49-(0)7721-9175-800

  2. Re: How to call ejbRemove after bean crashes?

    Solved it: the error was in ejbActivate(), which did not initialize the
    entity bean (according the the entity context).

    Best regards from snowy-wet Black Forest,
    Mattin
    ---
    Martin Heitz
    Distributed Network Accounting Team

    Elsag Solutions AG
    Roggenbachstr. 1
    D-78050 Villingen-Schwenningen
    Germany
    http://www.elsag-solutions.com
    Tel: +49-(0)7721-9175-595
    Fax: +49-(0)7721-9175-800

    > Hi,
    >
    > I would like to learn how to do it right:
    > I have an entity bean. Due to an error it crashed (RuntimeException that
    > got encapsulated in an EJBException).
    > The caller of the bean did not recognize the crash (how could he?) and
    > called ejbRemove on its local interface of the entity bean.
    > But now ejbRemove got invoked on another (not initialized) instance of
    > the entity bean and therefore ended up in another RuntimeException, the
    > ressources of the entity bean were not cleaned up and the entity bean
    > was not removed.
    >
    > Can I recognize from the local interface, if the bean instance in behind
    > was exchanged?
    > (I did by adding a toString() method in the local interface, but I would
    > like to know about a standard J2EE-way ;-)
    > Or do I really need to compare toString() output of the local interface
    > to recognize that the bean was exchanged? This sounds bad, because it
    > could have been exchanged in a regular manner by passivating and
    > reactivating it.
    >
    > Best regards from snowy Black Forest,
    > Mattin
    > ---
    > Martin Heitz
    > Distributed Network Accounting Team
    >
    > Elsag Solutions AG
    > Roggenbachstr. 1
    > D-78050 Villingen-Schwenningen
    > Germany
    > http://www.elsag-solutions.com
    > Tel: +49-(0)7721-9175-595
    > Fax: +49-(0)7721-9175-800


+ Reply to Thread