[Installation, Configuration & Deployment] - JBOSS timeout and locking problem
by _monkey_
Hi everyone, I am a newbie in JBOSS, so any help or suggestion would be very much appreciated :)
Previously I found that in my application, when there are 2 threads accessing the entity bean(which in turns access the mysql database), deadlock occurs even they were both just trying to read, so I changed the default configuration from pessimistic lock to SimpleReadWriteEJBLock by the following configuration in jboss.xml:
<container-configuration extends="Standard CMP 2.x EntityBean">
<container-name>Standard CMP 2.x EntityBean</container-name> <locking-policy>org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock</locking-policy>
</container-configuration>
after making this change, and rerunning the application, instead of deadlock, I get the following transaction timeout error from JBOSS:
13:54:06,906 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=andrewspc/108, BranchQual=, localId=108] timed out. status=STATUS_ACTIVE
13:54:07,140 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=andrewspc/110, BranchQual=, localId=110] timed out. status=STATUS_ACTIVE
13:54:07,203 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.lang.Integer com.patientrack.ejb.entityBean.AdmissionLocal.getAdmsnPK(), causedBy:
javax.ejb.EJBException: Transaction marked for rollback - probably a timeout.
at org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock.checkTransaction(SimpleReadWriteEJBLock.java:326)
at org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock.waitAWhile(SimpleReadWriteEJBLock.java:205)
at org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock.getWriteLock(SimpleReadWriteEJBLock.java:183)
at org.jboss.ejb.plugins.lock.SimpleReadWriteEJBLock.schedule(SimpleReadWriteEJBLock.java:89)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:85)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
at org.jboss.ejb.Container.invoke(Container.java:873)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:50)
at $Proxy123.getAdmsnPK(Unknown Source)
at com.patientrack.ejb.sessionBean.AdmissionManagerBean.convertAdmissionLocalToAdmission(AdmissionManagerBean.java:3463)
at com.patientrack.ejb.sessionBean.AdmissionManagerBean.loadAdmissionForAdmsnPk(AdmissionManagerBean.java:1385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at
has anyone encountered this kind of problems before? Is there any configuration that I need to pay attention to(JBOSS, JDBC, or MYSQL settings)? Help PLEASE...
THANKS!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971424#3971424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971424
19 years, 7 months
[JBoss Seam] - Re: ..:: Questions about Seam design!!!
by gcomnz
bfo81, if you'd like to use Seam with a separate back-end layer of any sort, it's quite easy to do so. Look at the CaveatEmptor CVS checkout from the Hibernate in Action book web site for nice generic DAO layer abstract classes if you're wanting to combine it with Hibernate.
I'd venture that you can pretty much always do without the DTO paradigm and just pass disconnected Hibernate entities back, even when you do want a DAO layer, perhaps excepting the case where you want a long-lasting API for published web services (for third parties).
I've had a lot of success so far working with a DAO layer, and in our case, a very large project that has a "business engine" that is accessed for multiple business lines and separate web-applications, it does seem appropriate and done right adds very little code overhead.
The best bit is that even with the layer in the back-end you can use components.xml to instantiate back-end entities and DAOs as Seam components in any scope without them having to have any Seam-specific coding.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971421#3971421
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971421
19 years, 7 months