Nittle Gupta wrote:
> Yes,I too want the answere to this question from sun people.
> >>If two client requests arrive to the same entity
> >>object (i.e. same primary key),
> >>the EJB container can do one of the following:
> >>
> >>    - use a different bean class instance for each
> >>transaction context, or
> >>
> >>    - use a single instance but serialize the use of
> >>the instance by the transactions
> >>
> >>If the first method is used, the underlying resource
> >>managers will properly
> >>isolate the work of the multiple clients.
> >
> >
> >I am a bit puzzled by this answer. In the situation
> >posited above, if two copies of an entity class are
> >used (one per transaction), and each transaction
> >modifies its copy, which copy is valid, which is
> >stored?

This depends on the locking mechanism of the database, and which
transaction isolation level is set. It is my understanding that if
optimistic locking is used and two concurrent transactions use the same
rows in a read/write scenario, the one to commit last will rollback (due
to the data changes by the first transaction). The transaction will in
this case have to be re-done in order to commit properly.

AFAIK

/Rickard

--
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684

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