duan xz [
http://community.jboss.org/people/duanxz] created the discussion
"use EJB3
issue:org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation"
To view the discussion, visit:
http://community.jboss.org/message/634537#634537
--------------------------------------------------------------
Hi,
my ejb3 application run in jbossAS7,when i rollback transaction in app demo appear this
error:
== server.log:==
1320214260246 [11-11-02 14:11:00.246] javax.ejb.ConcurrentAccessTimeoutException: EJB 3.1
FR 4.3.14.1 concurrent access timeout on org.jboss.invocation.InterceptorContext@1785fd3 -
could not obtain lock within 5MINUTES
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:97)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor$CustomSessionInvocationContext.proceed(SessionInvocationContextInterceptor.java:126)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.tx.StatefulBMTInterceptor.handleInvocation(StatefulBMTInterceptor.java:96)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:50)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.component.stateful.StatefulBMTInterceptor.processInvocation(StatefulBMTInterceptor.java:53)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:61)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:71)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
1320214260246 [11-11-02 14:11:00.246] at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
1320214260246 [11-11-02 14:11:00.246] at
com.appeon.server.services.transactionservice.TransactionServiceBean3$$$view1.execute(Unknown
Source)
==java code==
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.annotation.Resources;
import javax.ejb.CreateException;
import javax.ejb.Local;
import javax.ejb.PostActivate;
import javax.ejb.PrePassivate;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.Stateful;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import ASInterface.TransactionService;
@SuppressWarnings("serial")
@Stateful
@Local ({TransactionServiceBean3.class})
@TransactionManagement(TransactionManagementType.BEAN)
public class TransactionServiceBean3 extends AbstractTransactionService
implements SessionBean, TransactionService{
//~ Instance fields --------------------------------------------------------
/**
* DOCUMENT ME!
*/
@Resource
private SessionContext ctx;
//~ Methods ----------------------------------------------------------------
@PostActivate
public void ejbActivate()
{
System.out.println("1234567890::ejbActivate()");
}
public void ejbRemove()
{
System.out.println("1234567890::ejbRemove()");
}
@PreDestroy
public void remove(){
System.out.println("1234567890::remove()");
}
@PrePassivate
public void ejbPassivate()
{
}
@Resource
public void setSessionContext(SessionContext ctx)
{
System.out.println("duanxz nihao setSessionContext()");
this.ctx = ctx;
}
public void begin()
{
try
{
UserTransaction ut = (UserTransaction) ctx.getUserTransaction();
ut.setTransactionTimeout(18000);
ut.begin();
}
catch(IllegalStateException e)
{
Log.printStackTrace(e);
}
catch(SystemException e)
{
Log.printStackTrace(e);
}
catch(Throwable t)
{
Log.printStackTrace(t);
}
}
public void ejbCreate() throws CreateException
{
System.out.println("1234567890::ejbCreate()");
}
public void create() throws CreateException{
System.out.println("test 1234567890::create()");
}
public ReturnObject commitTransaction(int type)
{
try
{
System.out.println("TransactionServiceBean3.java 162");
UserTransaction tx = (UserTransaction) ctx.getUserTransaction();
tx.commit();
return new ReturnObject();
}
catch(Throwable t)
{
System.out.println("TransactionServiceBean3.java
Error174:"+t.getMessage());
Log.printStackTrace(t);
return new ReturnObject(Globals.ERROR_CODE,
"Failed to commit transaction due to :\n" + t.toString());
}
}
public ReturnObject rollbackTransaction(int type)
{
System.out.println("TransactionServiceBean3.java 196");
try
{
UserTransaction tx = (UserTransaction) ctx.getUserTransaction();
tx.rollback();
return new ReturnObject();
}
catch(Throwable t)
{
System.out.println("TransactionServiceBean3.java
Error213:"+t.getMessage());
Log.printStackTrace(t);
return new ReturnObject(Globals.ERROR_CODE,
"Failed to rollback transaction due to:\n" + t.toString());
}
}
}
Any help with this will be greatly appreciated.
Regards,
duanxz
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/634537#634537]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]