All,
I would really appreciate any help on this matter. I have run out of clues
!!
I'm having problems with transactions using JBoss 2(pre 4) Tomcat (3.2) JDK
1.3
I got JBoss/Tomcat using the same JVM, deploying using J2EE deployer data
source Oracle.
I was able to get this working with JBoss pre 2
The behavior I see is the following:
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.
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.StatefulSessionContainerConfig
uration">
<container-name>STATEFUL</container-name>
<call-logging>true</call-logging>
<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker<
/container-invoker>
<instance-pool>org.jboss.ejb.plugins.StatefulSessionInstancePool</instance-p
ool>
<instance-cache>org.jboss.ejb.plugins.StatefulSessionInstanceCache</instance
-cache>
<persistence-manager>org.jboss.ejb.plugins.StatefulSessionFilePersistenceMan
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.EntityContainerConfiguration">
<container-name>ENTITY</container-name>
<call-logging>true</call-logging>
<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker<
/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</persistenc
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]
[jBoss-User] Still problems with transactions [help]
Serrano, Miguel (AT-Atlanta) Sun, 29 Oct 2000 09:29:42 -0800
- RE: [jBoss-User] Still problems with transact... Serrano, Miguel (AT-Atlanta)
- RE: [jBoss-User] Still problems with tra... marc fleury
- RE: [jBoss-User] Still problems with tra... Serrano, Miguel (AT-Atlanta)
