Marc Thank you !!!!!!!!! I guess I've been looking at this for too long :) You guys are doing a terrific job. -----Original Message----- From: marc fleury [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 29, 2000 12:47 PM To: jBoss Subject: RE: [jBoss-User] Still problems with transactions [help] |A session bean updates data to an entity bean inside one method (one |transaction) |I see on console that the ejb store on the entity gets called for every |method called on the entity. this is normal. I believe you want to do exactly the contrary :))) define your session as "required" that means that when a method "inventory update" will start you will start a transaction. Now define your entity with "supports" and when the session will call it it will propagate the tx and set it on a sync but not commit since they didn't start it. when the session commits, each entity will recieve a callback from the sync and do the ejbStore dance... expect it to be slow since you do all at once... (make sure you use tuned updates) in clear swap the Required and Support tags below. marc | |Here are the relevant config (ejb-jar.xml and jboss.xml): | |ejb-jar.xml (Note: <trans-attribute>Required</trans-attribute>) | | <enterprise-beans> | <session> | <ejb-name>InventoryEJBBean</ejb-name> | <home>com.autotrader.inventory.impl.InventoryEJBHome</home> | <remote>com.autotrader.inventory.impl.InventoryEJB</remote> | |<ejb-class>com.autotrader.inventory.impl.InventoryEJBBean</ejb-class> | <session-type>Stateful</session-type> | <transaction-type>Container</transaction-type> | <ejb-ref> | <ejb-ref-name>ejb/CarEjbBean</ejb-ref-name> | <ejb-ref-type>Entity</ejb-ref-type> | <home>com.autotrader.inventory.impl.CarEjbHome</home> | <remote>com.autotrader.inventory.impl.CarEjb</remote> | <ejb-link>CarEjbBean</ejb-link> | </ejb-ref> | <resource-ref> | <res-ref-name>Oracle</res-ref-name> | <res-type>javax.sql.DataSource</res-type> | <res-auth>Container</res-auth> | </resource-ref> | </session> | <entity> | <ejb-name>CarEjbBean</ejb-name> | <home>com.autotrader.inventory.impl.CarEjbHome</home> | <remote>com.autotrader.inventory.impl.CarEjb</remote> | <ejb-class>com.autotrader.inventory.impl.CarEjbBean</ejb-class> | <persistence-type>Bean</persistence-type> | |<prim-key-class>com.autotrader.inventory.impl.CarEjbPK</prim-key-class> | <reentrant>False</reentrant> | <resource-ref> | <res-ref-name>Oracle</res-ref-name> | <res-type>javax.sql.DataSource</res-type> | <res-auth>Container</res-auth> | </resource-ref> | </entity> | </enterprise-beans> | <assembly-descriptor> | <container-transaction> | <description>REQUIRED</description> | <method> | <ejb-name>CarEjbBean</ejb-name> | <method-name>*</method-name> | </method> | <trans-attribute>Required</trans-attribute> | </container-transaction> | <container-transaction> | <description>SUPPORTS</description> | <method> | <ejb-name>InventoryEJBBean</ejb-name> | <method-name>*</method-name> | </method> | <trans-attribute>Supports</trans-attribute> | </container-transaction> | </assembly-descriptor> | <ejb-client-jar></ejb-client-jar> | </ejb-jar> | |............... | |jboss.xml (Note: |<transaction-manager>org.jboss.tm.TxManager</transaction-manager>) | |<jboss> | <secure>true</secure> | <container-configurations> | <container-configuration |configuration-class="org.jboss.ejb.deployment.StatefulSessionContai |nerConfig |uration"> | <container-name>STATEFUL</container-name> | <call-logging>true</call-logging> | |<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContaine |rInvoker< |/container-invoker> | |<instance-pool>org.jboss.ejb.plugins.StatefulSessionInstancePool</i |nstance-p |ool> | |<instance-cache>org.jboss.ejb.plugins.StatefulSessionInstanceCache< |/instance |-cache> | |<persistence-manager>org.jboss.ejb.plugins.StatefulSessionFilePersi |stenceMan |ager</persistence-manager> | <transaction-manager>org.jboss.tm.TxManager</transaction-manager> | <authentication-module></authentication-module> | <role-mapping-manager></role-mapping-manager> | <container-invoker-conf> | <Optimized>true</Optimized> | </container-invoker-conf> | <container-cache-conf> | |<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy |</cache-p |olicy> | <cache-policy-conf> | <min-capacity>10</min-capacity> | <max-capacity>1000</max-capacity> | <overager-period>600</overager-period> | <resizer-period>420</resizer-period> | <max-bean-age>1200</max-bean-age> | <max-cache-miss-period>10</max-cache-miss-period> | <min-cache-miss-period>1</min-cache-miss-period> | <cache-load-factor>0.75</cache-load-factor> | </cache-policy-conf> | </container-cache-conf> | </container-configuration> | <container-configuration |configuration-class="org.jboss.ejb.deployment.EntityContainerConfig |uration"> | <container-name>ENTITY</container-name> | <call-logging>true</call-logging> | |<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContaine |rInvoker< |/container-invoker> | |<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool> | |<instance-cache>org.jboss.ejb.plugins.EntityInstanceCache</instance-cache> | |<persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</p |ersistenc |e-manager> | <transaction-manager>org.jboss.tm.TxManager</transaction-manager> | <authentication-module></authentication-module> | <role-mapping-manager></role-mapping-manager> | <container-invoker-conf> | <Optimized>false</Optimized> | </container-invoker-conf> | <container-cache-conf> | |<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy |</cache-p |olicy> | <cache-policy-conf> | <min-capacity>10</min-capacity> | <max-capacity>1000</max-capacity> | <overager-period>600</overager-period> | <resizer-period>420</resizer-period> | <max-bean-age>1200</max-bean-age> | <max-cache-miss-period>10</max-cache-miss-period> | <min-cache-miss-period>1</min-cache-miss-period> | <cache-load-factor>0.75</cache-load-factor> | </cache-policy-conf> | </container-cache-conf> | <container-pool-conf> | <MaximumSize>100</MaximumSize> | <MinimumSize>10</MinimumSize> | </container-pool-conf> | <commit-option>C</commit-option> | </container-configuration> | </container-configurations> | <resource-managers> | <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource"> | <res-name>Oracle</res-name> | <res-jndi-name>Oracle</res-jndi-name> | </resource-manager> | </resource-managers> | <enterprise-beans> | <session> | <ejb-name>InventoryEJBBean</ejb-name> | <jndi-name>InventoryEJBBean</jndi-name> | <configuration-name>STATEFUL</configuration-name> | <ejb-ref> | <ejb-ref-name>ejb/CarEjbBean</ejb-ref-name> | <jndi-name>CarEjbBean</jndi-name> | </ejb-ref> | <resource-ref> | <res-ref-name>Oracle</res-ref-name> | <resource-name>Oracle</resource-name> | </resource-ref> | </session> | <entity> | <ejb-name>CarEjbBean</ejb-name> | <jndi-name>CarEjbBean</jndi-name> | <configuration-name>ENTITY</configuration-name> | <resource-ref> | <res-ref-name>Oracle</res-ref-name> | <resource-name>Oracle</resource-name> | </resource-ref> | </entity> | </enterprise-beans> | </jboss> | | |Thanks in advance | | |Miguel | | |-- |-------------------------------------------------------------- |To subscribe: [EMAIL PROTECTED] |To unsubscribe: [EMAIL PROTECTED] |Problems?: [EMAIL PROTECTED] | | -- -------------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED] -- -------------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]
RE: [jBoss-User] Still problems with transactions [help]
Serrano, Miguel (AT-Atlanta) Sun, 29 Oct 2000 10:02:59 -0800
- [jBoss-User] Still problems with transactions... Serrano, Miguel (AT-Atlanta)
- RE: [jBoss-User] Still problems with tra... marc fleury
- Serrano, Miguel (AT-Atlanta)
