I've investigated a little bit into the sourcecode (CVS as of April, 29th)
and found the following in TxCapsule.registerSynchronization():
// OSH: EntitySynchronizationInterceptor bug is fixed long ago,
// and since nobody seems to get the warning anymore it should
// be safe to be JTA-conformant.
// In case of trouble, try changing "true" below to "false".
if (true)
throw new RollbackException("Already marked for rollback");
else {
// Workaround for EntitySynchronizationInterceptor bug.
Logger.warning("TxCapsule: Violating JTA by adding
synchronization to a transaction marked for rollback.");
break;
}
I did change "true" to "false" and voila, no LOCKING-WAITING anymore. Of
course I got the expected warning on the console, followed by this stack
trace:
[Specification] TxCapsule: Violating JTA by adding synchronization to a
transaction marked for rollback.
[Specification] javax.ejb.EJBException
[Specification] at
org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManage
r.java:396)
[Specification] at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor$InstanceSynchronizati
on.beforeCompletion(EntitySynchronizationInterceptor.java:342)
[Specification] at
org.jboss.tm.TxCapsule.doBeforeCompletion(TxCapsule.java:1228)
[Specification] at org.jboss.tm.TxCapsule.rollback(TxCapsule.java:410)
[Specification] at
org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:88)
[Specification] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:307)
[Specification] at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[Specification] at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:19
0)
[Specification] at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[Specification] at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:323)
[Specification] at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:392)
[Specification] at java.lang.reflect.Method.invoke(Native Method)
[Specification] at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
[Specification] at sun.rmi.transport.Transport$1.run(Transport.java:152)
[Specification] at java.security.AccessController.doPrivileged(Native
Method)
[Specification] at
sun.rmi.transport.Transport.serviceCall(Transport.java:148)
[Specification] at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
[Specification] at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
06)
[Specification] at java.lang.Thread.run(Thread.java:484)
Obviously, the bug in EntitySynchronizationInterceptor is still there :-(
Will anybody fix this for release 2.2.2? We're going to use JBoss in a
productive environment, so I'd like to use the stable 2.2 branch instead of
the 2.3 developer version.
Achim
----- Original Message -----
From: "danch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 27, 2001 8:33 PM
Subject: Re: [JBoss-user] LOCKING-WAITING after setRollbackOnly()
> I'll put together a little sample and look into this. By my reading of
> the spec, you should be able to call into the bean (even the same
> instance) after you call setRollbackOnly and throw an application
> exception. Even if that weren't legal, locking-waiting would not be what
> we'd want to see.
>
> -danch
>
> Achim Demelt wrote:
> >
> > > What version of JBoss is this?
> > >
> >
> > 2.2 binary distribution w/ tomcat 3.2.1
> >
> > > The Classification that's being passed in is null, correct? Otherwise
> > > commenting out the call to setRollbackOnly should have no effect.
> > >
> >
> > Yes, it's null. Oops, I see I've copied the wrong method into the email,
but
> > anyway, all three methods (setClassification, setStatus, setType) have a
> > similar implementation, and are all called with null arguments. So
> > setRollbackOnly is definitely called.
> >
> > > The test client calls the entity directly (not through a session
> > > wrapper), correct?
> > >
> >
> > Correct.
> >
> > Achim
> >
> > > -danch
> > >
> > > Achim Demelt wrote:
> > > >
> > > > hi,
> > > >
> > > > I have a CMP entity bean and a simple test client. one of the bean
> > methods
> > > > is
> > > >
> > > > public void setClassification(Classification param) throws
> > > > LocalizedAppEventException {
> > > > if (param == null) {
> > > > ctx.setRollbackOnly();
> > > > throw new
> > > > LocalizedAppEventException("isis.masterdata.invalidClassification");
> > > > }
> > > > this.classification = param.intValue();
> > > > }
> > > >
> > > > the client calls this method and another one, which is more or less
> > > > identical to the one above:
> > > >
> > > > try {
> > > > spec.setStatus(null);
> > > > }
> > > > catch (LocalizedAppEventException e) {
> > > > // that's ok, ignore
> > > > }
> > > >
> > > > try {
> > > > spec.setType(null);
> > > > }
> > > > catch (LocalizedAppEventException e) {
> > > > // that's ok, ignore
> > > > }
> > > >
> > > > the first invocation is OK, the exception is thrown. on the second
> > > > invocation, though, the client hangs. the server produces this line
in
> > the
> > > > log file:
> > > >
> > > > [Specification] LOCKING-WAITING (TRANSACTION) for id
> > > > com.tiscon.isis.masterdata.ejb.SpecificationPK@1e ctx.hash 2721646
> > > > tx:TransactionImpl:XidImpl [FormatId=257, GlobalId=c197//81,
> > BranchQual=]
> > > >
> > > > As far as I've understood earlier postings in the list, this message
> > usually
> > > > occurs in case of a deadlock with non-reentrant beans. OK, my bean
*is*
> > > > non-reentrant, but there is only one client thread, and, obviously,
no
> > > > callbacks. If I uncomment the call to setRollbackOnly() everything
works
> > > > fine. What's the problem here?
> > > >
> > > > Thanks,
> > > > Achim
> > > >
> > > > _______________________________________________
> > > > JBoss-user mailing list
> > > > [EMAIL PROTECTED]
> > > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> > > Confidential e-mail for addressee only. Access to this e-mail by
anyone
> > else is unauthorized.
> > > If you have received this message in error, please notify the sender
> > immediately by reply e-mail
> > > and destroy the original communication.
> > >
> > >
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> > >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
> Confidential e-mail for addressee only. Access to this e-mail by anyone
else is unauthorized.
> If you have received this message in error, please notify the sender
immediately by reply e-mail
> and destroy the original communication.
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user