Hi!
Everytime I use a read-only pattern(get*) on my EntityBean, the pessimistic locking stops working (for other methods also)! It behaves just like optimistic locking. I experimented for a few days, I read the forums and the JBoss 4.0 Book, there is nothing on this behaviour.
some of the xdoclet tags (the ones that count):
/** * Autogenerated EJB implementation class for SystemKontoEB * * * * @ejb.bean * generate = "true" * name = "SystemKontoEB" * type = "CMP" * cmp-version = "2.x" * view-type = "local" * local-jndi-name = "ejb/SystemKontoEB" * reentrant = "true" * * @jboss.container-configuration * name = "Standard CMP 2.x EntityBean Pessimistic" * * @jboss.cache-invalidation * value = "true" * * @jboss.cache-invalidation-config * invalidation-group-name = "SystemKontoEBGroup" * * @jboss.tuned-updates * * @jboss.entity-command * name = "no-select-before-insert" * * @jboss.read-ahead * strategy = "on-load" * page-size = "20" * * @ejb.util * generate = "physical" * * @ejb.transaction * type = "Required" * * @ejb.persistence * table-name = "SYSTEMKONTO" * * @jboss.method-attributes * pattern = "get*" * read-only = "true" */
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>