Where are the EJB2 CMP container-configuration in JBoss EAP 6.0.x
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.0
- 6.1
Issue
- In JBoss 4.0.3SP1, we have these container configurations. These container configurations allow us to control the EJB CMP 2.1 lifecycle. The parameters like sync-on-commit-only, insert-after-ejb-post-create and call-ejb-store-on-clean are made use of in our JBoss 4 configuration. This is very essential for our application, In the absence of these settings, the EJB container is calling the ejbStore too soon (default EAP6 implementation). This is causing serious issues to our application and it is rather rendering it unusable. We need to be able to delay the EJB sync till the end of the transaction and insert till after EJB post create.
- In EAP 5.1, I can configure "container-cache-conf" properties for EJB in "jboss.xml", how can I do it on EAP 6.x?
Resolution
Upgrade to JBoss EAP 6.1 or request a one off patch and the options can be set on the entity in jbosscmp-jdbc.xml for example below. Note the DTD needs to be 4.1 for the options to be valid sync-on-commit-only, insert-after-ejb-post-create, and call-ejb-store-on-clean. Or remove the DTD declaration.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 4.1//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_1.dtd">
<jbosscmp-jdbc>
...
<entity>
<ejb-name>Student</ejb-name>
<create-table>true</create-table>
<remove-table>true</remove-table>
<table-name>STUDENT</table-name>
...
<sync-on-commit-only>true</sync-on-commit-only>
<insert-after-ejb-post-create>true</insert-after-ejb-post-create>
<call-ejb-store-on-clean>false</call-ejb-store-on-clean>
</entity>
</jbosscmp-jdbc>
And same to these container configurations:
<container-configuration>
<container-name>Clustered CMP 2.x EntityBean</container-name>
<call-logging>false</call-logging>
<invoker-proxy-binding-name>clustered-entity-rmi-invoker</invoker-proxy-binding-name>
<sync-on-commit-only>false</sync-on-commit-only>
<insert-after-ejb-post-create>false</insert-after-ejb-post-create>
<container-interceptors>
...
</container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
<instance-cache>org.jboss.ejb.plugins.EntityInstanceCache</instance-cache>
<persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>50</min-capacity>
<max-capacity>1000000</max-capacity>
<overager-period>300</overager-period>
<max-bean-age>600</max-bean-age>
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</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>
</container-pool-conf>
<commit-option>B</commit-option>
</container-configuration>
There is a bug fix patch for this issue on EAP 6.0.x, including various of EJB bug fixes, can be downloaded This content is not included.here
Root Cause
Content from issues.jboss.org is not included.EJB 2.1 CMP configuration options missing sync-on-commit-only, insert-after-ejb-post-create, call-ejb-store-on-clean
Content from issues.jboss.org is not included.https://issues.jboss.org/browse/JBPAPP6-1688
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.