Hello Javier, you should use Instance Per Transaction for OL, as Simone wrote. And to answer your question, commit option A won't work with it.
IPT is used because it is the only correct way to allow access to the same entity instances from different transactions. alex Wednesday, July 09, 2003, 5:37:09 PM, Javier Soltero wrote: JS> Alex, JS> When we use pessimistic, we get tons of deadlocks. More even than what we were seeing in 3.0.6. The situation it occurs most times is when a value object is being retrieved from an entity bean. JS> The value object in most cases is pulled with some CMR's as well but it fails on value objects that do not include CMRs as well. JS> This is our container configuration: JS> <container-configuration> JS> <container-name>Standard CMP 2.x EntityBean</container-name> JS> <call-logging>false</call-logging> JS> <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name> JS> <sync-on-commit-only>false</sync-on-commit-only> JS> <container-interceptors> JS> <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor> JS> <interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor> JS> <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor> JS> <interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor> JS> </container-interceptors> JS> <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool> JS> <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache> JS> <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager> JS> <!-- Let's try optimistic locking - jcobb 7/3/2003 --> JS> <!-- <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy> --> JS> <locking-policy>org.jboss.ejb.plugins.lock.JDBCOptimisticLock</locking-policy> JS> <container-cache-conf> JS> <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy> JS> <cache-policy-conf> JS> <min-capacity>50</min-capacity> JS> <max-capacity>1000000</max-capacity> JS> <overager-period>300</overager-period> JS> <max-bean-age>600</max-bean-age> JS> <resizer-period>400</resizer-period> JS> <max-cache-miss-period>60</max-cache-miss-period> JS> <min-cache-miss-period>1</min-cache-miss-period> JS> <cache-load-factor>0.75</cache-load-factor> JS> </cache-policy-conf> JS> </container-cache-conf> JS> <container-pool-conf> JS> <MaximumSize>100</MaximumSize> JS> </container-pool-conf> JS> <!-- Covalent CAM - Using commit-option A again - jcobb 7/3/2003 --> JS> <commit-option>A</commit-option> JS> </container-configuration> JS> Our jbosscmp-jdbc includes this: JS> <optimistic-locking> JS> <version-column/> JS> <field-name>versionField</field-name> JS> <column-name>ol_version</column-name> JS> <jdbc-type>INTEGER</jdbc-type> JS> <sql-type>INTEGER</sql-type> JS> </optimistic-locking> JS> We're using a version strategy applied to all beans. From the looks of it, the counter is being updated even on operations which do not change the database, since after a couple of read JS> operations in our app, I see the counter get incremented up to 7 times. JS> One thing which may have something to do with this is our use of xdoclet. We're using a version of 1.2 which was somewhere before b2 (we used a date tag). We've applied a few patches for value JS> object related things, but the dd's its generating are being marked against jboss v.3.0. I am separately working on trying to figure out if we can make the move to 1.2b3. (Any suggestions in this JS> department also welcomed :)) JS> Thank you for your help, JS> -javier >> -----Original Message----- >> From: Alexey Loubyansky [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, July 09, 2003 6:36 AM >> To: Javier Soltero >> >> Hello Javier, >> >> - if you change locking policy to pessimistic (in 3.2.1) does >> reentrance occur? >> - could you describe the situation when it occurs? >> - how do you configure optimistic locking? >> >> Thanks, >> >> alex >> >> >> Wednesday, July 09, 2003, 3:31:49 AM, Javier Soltero wrote: >> >> JS> Hi, >> >> JS> We're in the process of migrating an application from 3.0.6 to 3.2.1. Our >> main interest was to use Optimistic Locking for our many Entity Beans. We have >> the application running, using the version >> JS> strategy for OL, and during most calls to our backend (which is composed >> of session fa�ade beans and entity beans), we get errors such as the one below >> indicating that a reentrant method call was >> JS> detected. All the api's in our session beans have tx required, and we're >> using read-only method directives in the entity layer for every non-write >> method. >> >> JS> Has anyone else seen problems like these? This does not occur with 3.0.6 + >> PessimisticLocking >> >> >> JS> Oh, and we're using commit-option A. >> >> >> JS> Any help will be greatly appreciated. >> >> JS> Thanks, >> >> JS> -javier >> >> >> >> JS> 2003-07-08 15:36:02,881 ERROR [org.jboss.ejb.plugins.LogInterceptor] >> TransactionRolledbackLocalException, causedBy: >> JS> javax.ejb.EJBException: Reentrant method call detected: Platform [.10001.] >> JS> at >> org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInter >> ceptor.java:73) >> JS> at >> org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceIntercept >> or.java:174) >> JS> at >> org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java: >> 89) >> JS> at >> org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationIntercept >> or.java:53) >> JS> at >> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.j >> ava:84) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.ja >> va:273) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104) >> JS> at >> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117) >> JS> at >> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) >> JS> at >> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderI >> nterceptor.java:122) >> JS> at >> org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:483) >> JS> at org.jboss.ejb.Container.invoke(Container.java:674) >> JS> at >> org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory >> .java:353) >> JS> at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) >> JS> at $Proxy355.getPlatformValue(Unknown Source) >> JS> at >> net.covalent.spider.appdef.server.session.AgentManagerEJBImpl.getAgent(AgentMa >> nagerEJBImpl.java:379) >> JS> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> JS> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> JS> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j >> ava:25) >> JS> at java.lang.reflect.Method.invoke(Method.java:324) >> JS> at >> org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessS >> essionContainer.java:629) >> JS> at >> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cached >> ConnectionInterceptor.java:186) >> JS> at >> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSess >> ionInstanceInterceptor.java:72) >> JS> at >> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.j >> ava:84) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.ja >> va:243) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104) >> JS> at >> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117) >> JS> at >> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) >> JS> at >> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderI >> nterceptor.java:122) >> JS> at >> org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContain >> er.java:322) >> JS> at org.jboss.ejb.Container.invoke(Container.java:674) >> JS> at >> org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory >> .java:353) >> JS> at >> org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy >> .java:83) >> JS> at $Proxy346.getAgent(Unknown Source) >> JS> at >> net.covalent.spider.measurement.server.session.SessionEJB.getAgentConnection(S >> essionEJB.java:297) >> JS> at >> net.covalent.spider.measurement.server.session.MeasurementProcessorEJBImpl.sch >> eduleRawMeasurements(MeasurementProcessorEJBImpl.java:309) >> JS> at >> net.covalent.spider.measurement.server.session.MeasurementProcessorEJBImpl.sch >> edule(MeasurementProcessorEJBImpl.java:175) >> JS> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> JS> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> JS> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j >> ava:25) >> JS> at java.lang.reflect.Method.invoke(Method.java:324) >> JS> at >> org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessS >> essionContainer.java:629) >> JS> at >> org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cached >> ConnectionInterceptor.java:186) >> JS> at >> org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSess >> ionInstanceInterceptor.java:72) >> JS> at >> org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.j >> ava:84) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.ja >> va:243) >> JS> at >> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104) >> JS> at >> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117) >> JS> at >> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) >> JS> at >> org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderI >> nterceptor.java:122) >> JS> at >> org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContain >> er.java:322) >> JS> at org.jboss.ejb.Container.invoke(Container.java:674) >> JS> at >> org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory >> .java:353) >> JS> at >> org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy >> .java:83) ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
