> >as if one transaction ran, then the other - it's "serialized").  If the
> >first txn tries to update data the second transaction updated,
> then it gets
> >rolled back.
>
>   Hi Micheal,  thanks for the comments. One question I have then
> is how does
> the ejbCode catch the transaction rollback and notify the client?
>  That is,
> if in your session bean code you update some entity beans, as far
> as I know,
> they won't be committed until the entire transaction is over (the session
> bean crosses the end of its "method"), and control allready
> returned to the
> client.   If this is so, where can we place exception handling
> code to catch
> transaction collisions?

This is nothing other than the usual - before the session bean's transaction
has completed (most probably when it is near the end and is trying to
commit),
the database will notify the container and the transaction has to be rolled
back since the underlying data has changed, and the session bean will most
probably
throw an exception to the client (though it could try the whole thing over
again and hopefully the same situation won't happen twice on the same data).

Oh I see the source of confusion here - it's my wording of "as if one, then
the
other".  This is only true when it succeeds.  The database is responsible
for
isolating the transactions from each other by remembering any changes
(including
inserts) other transactions have done that may affect the state of the data
that is used by the transaction (typically) from the point when it first
starts.  If "crossovers" happen, then things aren't so "serialized" - the
second transaction will affect the first.

Michael

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