I think you might find the answer if you reconsider what "do some updates on
itemA and itemB" mean in this context.  If you consider the transactional
element to be the whole vector, which when the processing is done, is either
updated or "rolled back" at that time, then your logic can be simplified by
NOT having to perform interim commits on the individual items A and B -
note: you will have to maintain a temporary cache on B which you can update
at the end as part of a separate transaction.

Hope this helps.

Ermine Todd III
[EMAIL PROTECTED]
Applications Engineer
Brokat Server Technologies
503-533-3711


-----Original Message-----
From: Kurt Byrnes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 3:52 PM
To: [EMAIL PROTECTED]
Subject: Transaction scoping help needed


Hello,

I need a bit of help trying to figure how to get this pseudo code to
rollback correctly in one or more stateless session
beans manipulating some entity beans. Without nested transactions
(Weblogic), I'm at a loss.
I can't think of a clean way to describe it in words so here's the idea.

Enumeration e = vector.elements()
while ( e.hasMoreElements() ) {
    itemA = e.nextElement()
    while( itemA.quantity > 0 ) {
        if ( can find matching itemB ) {
            do some updates on itemA and itemB
        } else {
            if ( itemA.isSpecial ) {
                rollback EVERYTHING
<---------------
            } else {
                rollback any changes to this itemA and itemB
<---------------
            }
        }
    }
}


Thanks is advance,

Kurt Byrnes

===========================================================================
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".

===========================================================================
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