Sachin Aggarwal wrote:

> We want certain business method calls to be synchronized.
>
> Setting the transactional attribute to TRANSACTION_SERIALIZABLE on the session
> bean which starts the transaction doesn't help because the EJB
> server(weblogic) doesn't lock/synchronize  the method call and leaves it to
> the database to do ther transaction management, which being oracle and
> implementing optimistic concurrency i.e snapshot instead of locking - let's
> both of them proceed and eventually both the method calls fail.
>
> What would be the right solution for such problem ? Since we are not supposed
> to use "Synchronized" methods in EJB - should we implement our own locking ?

Implementing your own locking mechanism would be a big mistake. It would be
difficult would not work on any EJB server (including WebLogic) that runs work
in multiple JVMs for scaleability.

The obvious answer is to use a database that supports pessimistic concurrency.
Or redesign the application to work with optimistic concurrency.

Ian McCallion

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