> I'm not shure if this is dumb question -
> how is locking handled in JOnAS, optimistic or
> pessimistic locking or no locking at all?
>
> How, if possible, do I influence lock�ng?
>
> Thanks, Max
hi,
For handling concurrent access on the same entity bean from
multiple transactions, JOnAS has implemented the first strategy
described in the EJB Spec (� 9.1.11).
We have multiple instances of the entity bean, one for each
transaction in which the entity bean object is being accessed.
The transaction synchronization is performed by the underlying database
during the database access calls performed by the business methods via
the driver JDBC.
In JOnAS the locking policy depends of the default isolation level of
the driver JDBC used.
In the EJB 1.0 specification it was said that the isolation level may be
set
in the deploiement descriptor but we haven't implemented this
fonctionality
because we knew that it will change with EJB 1.1.
Furthermore it was not possible to explicitly change the isolation level
with
the Oracle thin JDBC driver we used...
In the spec EJB1.1 (� 11.3.2) it is said that for session beans with
bean_managed demarcation, isolation level may be set programmatically in
the EJB method using for example
java.sql.Connection.setTransactionIsolation(..)
But for the entity beans using container-managed persistence I must
confess
that the spec is not clear:
"... transaction isolation is managed by the data access classes that
are
generated by the container provider's tools. The tools must
ensure that the management of isolation levels performed by the data
access class
will not result in conflictiong isolation requests for a resource
manager
within a transaction."
So, in order to sum up, in the current version of JOnAS,for entity bean
with container-managed persistence, the locking policy
depends of the default isolation level of the driver JDBC you are using
which usually is an pessimistic locking policy.
Best reagrds,
--
Philippe
Philippe Coq Groupe Bulll/BullSoft/OpenMaster Phone: (33) 04 76 29 78
49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED] http://www-frec.bull.com
Download our EJBServer at http://www.bullsoft.com/ejb