I think this is a bug that was fixed. I don't remember in which version, though.
To workaround the caching you should not set read-only to true for containers with commit option B and C.


[EMAIL PROTECTED] wrote:

Alexey,

Thank you for your reply.

Does this mean that it is a bug in JBoss? I'm currently using JBoss 3.2.2.

Or do I have to configure my beans in some other way in jboss.xml?

Thanks,

Harm de Laat
Informatiefabriek
The Netherlands




Alexey Loubyansky <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED]
12/11/2003 02:28 PM
Please respond to
[EMAIL PROTECTED]



To [EMAIL PROTECTED] cc

Subject
Re: [JBoss-user] Commit type question






Sorry, editted version of my response...


If a bean/method has a read-only true in jboss.xml it is not associated with the transaction and is not participating in synchronizaion when the tx commits and remains in the cache.

This issue was reported recently and it seems to me Adrian fixed it.
AFAIK, the instance will be evicted from the cache at the end of the invocation unless
the container is configured with option A.


The nuance is that, if you try to access the instance again, in the same transaction it will be RELOADED from the database.


[EMAIL PROTECTED] wrote:


Hi all,

I have an EJB application. In this application some entity beans should use commit type 'A' (I own the database).
And some Entities should use commit type 'B'. (They can be modified using the database client, MySQL).


I have the following deployment descriptor (jboss.xml) snippet:

       <entity>
        <ejb-name>Config</ejb-name>
        <local-jndi-name>Config</local-jndi-name>

       <method-attributes>
           <method>
             <method-name>get*</method-name>
             <read-only>true</read-only>
           </method>
       </method-attributes>

</entity>
<entity>
<ejb-name>Relation</ejb-name>
<local-jndi-name>Relation</local-jndi-name>
<configuration-name>Standard CMP 2.x EntityBean and Cache</configuration-name>


       <method-attributes>
           <method>
             <method-name>get*</method-name>
             <read-only>true</read-only>
           </method>
       </method-attributes>

</entity>

In standardjboss.xml I added:

<container-configuration>
<container-name>Standard CMP 2.x EntityBean and Cache</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



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>




<interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor>


        </container-interceptors>
<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>


<instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</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>A</commit-option>
     </container-configuration>

I would expect that the Config Entity bean now uses commit type 'B'. And the Relation Entity Bean now uses commit type 'A'.

The thruth however is that both entities now use commit type 'A'.

If I modify the Config entity values using the database client (mysql), I have to redeploy my application in order to see my changes in my EJB application.

Can somebody explain to me what it is that i'm doing wrong?

Thanks you very much,

Harm de Laat
Informatiefabriek




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user





------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to