4 Replies Latest reply on Aug 30, 2005 4:45 AM by vickyk

    How to force immediate commit of an entity bean to the persi

      Hi,

      I would like to have an entity bean serialized to the persistent storage as soons as it is modified (or even better, on request).
      I am working with a Jboss 4.02, EJB 2.1.

      How do I do that?

      Bruno.

        • 1. Re: How to force immediate commit of an entity bean to the p
          vickyk

          Can you check the Commit Options in the EJB specs for the details , the Jboss does support additional commit option D?
          Regards
          Vicky

          • 2. Re: How to force immediate commit of an entity bean to the p

            Hi,

            Thanks for your reply.
            I thought about that too and tried to implement a container configuration (details below) with option D and optiond-refresh-rate set at 30 (seconds).

            I have been watching ejbStore on the entity bean, but nothing happened....

            Any Clue?

            Cheers

            Bruno

            <container-configurations>
             <container-configuration>
             <container-name>Option D30</container-name>
             <call-logging>false</call-logging>
             <invoker-proxy-binding-name>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>
             <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
             <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
             <interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
             <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
             <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
             </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.BMPPersistenceManager</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>D</commit-option>
             <optiond-refresh-rate>30</optiond-refresh-rate>
             </container-configuration>
            </container-configurations>
            


            • 3. Re: How to force immediate commit of an entity bean to the p
              vickyk

               

              "bgrieder" wrote:
              Hi,

              Thanks for your reply.
              I thought about that too and tried to implement a container configuration (details below) with option D and optiond-refresh-rate set at 30 (seconds).

              I have been watching ejbStore on the entity bean, but nothing happened....

              Any Clue?

              Cheers

              Bruno

              For immediate call to ejbStore you need to set commit Option C . Why are you putting commit Option D as it is similar to the A . Please refer to the Section 11.8.1 of the admin docs of Jboss for details .
              "bgrieder" wrote:

              <container-configurations>
               <container-configuration>
               <container-name>Option D30</container-name>
               <call-logging>false</call-logging>
               <invoker-proxy-binding-name>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>
               <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
               <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
               <interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
               <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
               <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
               </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.BMPPersistenceManager</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>D</commit-option>
               <optiond-refresh-rate>30</optiond-refresh-rate>
               </container-configuration>
              </container-configurations>
              

              Since you have changed the container name from the default Standard BMP EntityBean , how do u tell the ejb that it has got to use Option D30 . I feel some things are missing from your side inconfiguration .
              Well give me some time as i need to prepare the demo ejb and then test , and on top of that I need to configure DataSource arrange database on my system
              I will test the same again I have not being playing with Entity Beans from long .
              Regards
              Vicky

              • 4. Re: How to force immediate commit of an entity bean to the p
                vickyk

                Hi ,
                I have been able to run the sample examples very well with the Jboss for the commit options A, B and C . I have downloaded the sample examples from the Orielley Workbook .
                How did you checked if the ejbStore() is called or not , did you put any log statement ?
                Regards
                Vicky