Hi Folks,

I have been watching this thread for sometime and got a doubt here.

Pablo mentioned that the ejbLoad is executed after the commit...I may be wrong but I am not aware about any such requirement in the spec. Isn't this container spec..

Pablo which container are you using?

Cheerio,
Vineeth.


Pablo Schor wrote:
I can't, Evan, since I've already commited the transaction. The code in the
session bean goes like this:

UserTransaction ut = null;
try {
        BMPDataBean dataBean = getHome().findByPrimaryKey( pk );
        ut = m_context.getUserTransaction();
        ut.begin();
        dataBean.setXXX ( xxx );
        dataBean.setYYY ( yyy );
        ut.commit();
}
    catch (EJBException e) {
            e.printStackTrace();
}
    catch (NamingException e) {
            e.printStackTrace();
}
    catch (Exception e) {
            e.printStackTrace();
}



The thing is when the session bean commits, the container executes ejbLoad -
wich fails when the version is incorrect.

Throwing EJBException doesn't prevent the commit. I need the commit to fail
under some circumstances, I jus't don't find the way to make it fail.

PS



----- Original Message -----
From: "Evan Ireland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 14, 2004 8:00 PM
Subject: Re: BMP/T, optimistic locking and trying to revert a commit


  
Throw an EJBException from EJBStore. Catch the exception in the SB
and call rollback, then retry.

    
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to