I ran into this same problem a while ago, and I suggested the same (at
least the thread, that holds the lock, should not be locked out).
Somebody wrote a 'SimpleReadWriteEJBLock' class, that seems to achieve
exactly this, but I could not find any info related to it.

You can also try to play around with the method attribute read-only
setting in jboss.xml (see the DTD).
To get better concurrency you may consider switching to the Instance Per
Transaction configuration (see standardjboss.xml) .

The QueuedPessimisticEJBLock does not make any sense with CMP, IMHO (if
you use it, it turns JBoss into a single tasking system).


Georg



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:jboss-user-admin@;lists.sourceforge.net] On Behalf Of Jim
Crossley
Sent: Thursday, October 24, 2002 22:06
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Erroneous deadlock detected???


Well, it would seem to me that a ThreadLocal instance could help solve
this problem.  If one thread tries to acquire a lock it already owns, it
ought to get it, right?

If we were to apply the same semantics you describe to a simple Java
class, then calling setX would always block...

class C
{
  synchronized void setX() {
    setY();
  }
  synchronized void setY() {
    ;
  }
}

If this is really the way JBoss works, and nobody knows a good reason
why it should, can someone point me to the package/class responsible for
this behavior and I'll take a whack at fixing it?

Thanks,
Jim

On Thu, 2002-10-24 at 15:40, Michael Bartmann wrote:
> Explanation attempt inline.
> 
> Regards,
> Michael Bartmann
> 
> Jim Crossley wrote:
> > I have an MDB with the following pseudocode in its onMessage method:
> > 
> > public void onMessage(Message msg)
> > {
> >   // Entity bean = home.create(...)
> >   // bean.setX(...)
> this starts a tx1 and locks the instance bean.
> >   // bean.setY(...)
> this suspends the tx1 on bean temporarily,
> and starts a tx2, which tries to obtain the lock on the bean, which it

> will never get, because tx1 is not commited or rollbacked yet.
> We had this problem under 2.4.4 w/o deadlock detection. Problem:
> even the tx timeout didn't work in this case; the server locked
forever... :-(
> > }
> > 
> > Each of the three methods, create, setX, and setY have a 
> > trans-attribute of "RequiresNew".  With only one client posting a 
> > message, a "deadlock detected" exception is thrown when setX is 
> > invoked.  How can deadlock occur when only one thread is active
> > 
> > Thanks,
> > Jim
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by: Influence the future
> > of Java(TM) technology. Join the Java Community 
> > Process(SM) (JCP(SM)) program now. 
> >
http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javav
ote
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community 
> Process(SM) (JCP(SM)) program now. 
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0003en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user




-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0003en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to