read only methods
colebatchd Aug 10, 2002 9:28 AMHi,
This is mainly a question in relation to the thread http://www.mail-archive.com/jboss-user@lists.sourceforge.net/msg18814.html//www.mail-archive.com/jboss-user@lists.sourceforge.net/msg18814.html
I'm running on 3.0RC1/Sun1.3/2k/Postgres7.2.
I'm not 100% if what I'm trying to do should work - but it makes sense. Basically I have a deadlock detection exception raised on a getId() method which is obviously a readonly method. So I found this email from Bill and tried to make it work (btw - the DTD doesn't permit this, should it?).
Here's the relevant snippet from jboss.xml:
<ejb-name>Page</ejb-name>
<local-jndi-name>Page</local-jndi-name>
<resource-ref>
<res-ref-name>jdbc/DataSource</res-ref-name>
<resource-name>java:/PostgresDS</resource-name>
</resource-ref>
<method-attributes>
<method-name>getId</method-name>
<read-only>true</read-only>
</method-attributes>
and part of the stack trace:
22:25:46,499 ERROR [BeanLock] Application deadlock detected: TransactionImpl:Xid
Impl [FormatId=257, GlobalId=hobbes//300, BranchQual=] has deadlock conditions
22:25:46,499 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
org.jboss.ejb.plugins.lock.ApplicationDeadlockException: application deadlock de
tected
at org.jboss.ejb.plugins.lock.BeanLockSupport.deadlockDetection(BeanLock
Support.java:190)
at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.waitForTx(QueuedP
essimisticEJBLock.java:282)
at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(Queued
PessimisticEJBLock.java:189)
at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPe
ssimisticEJBLock.java:140)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
tor.java:103)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
Interceptor.java:69)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:96)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:176)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
1)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:129)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:183)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLoca
lContainerInvoker.java:296)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
at $Proxy707.getId(Unknown Source)
at net.sportspaper.cma.ejb.StoryEJB.publish(StoryEJB.java:142)
line 142 of StoryEJB is this:
Long id = storyPage.getId();
(broken into one line to identify for sure what the problem was).
Could someone confirm/deny that what I'm trying to do should work, and maybe point out what I'm doing wrong?
cheers
dim
ps - what happened to support for