We recently "fixed" our application configuration for read-only beans.  We 
have seen great increases in speed and a reduction in deadlocks.  Now we have 
the issue of read-only beans not updating from the DB after updates.  
Eventually they drop off and reload, but it doesn't seem to happen in the 
time specified in the jbosscmp-jdbc.xml file (5 sec).  The beans seem to 
stick around more than 30 minutes.  Is there something I am missing?

The only other thing I should mention is that each of that read-only and 
standard beans for the same table share the same class files.  The JBoss 
configuration is duplicated with a different ejb-name for the read-only bean.  
This didn't cause us any issues before, but then we didn't have read-only 
working properly before.

The most troublesome is our product bean which has the following configuration 
(edited for brevity):

ejb-jar.xml:
    <entity>
      <ejb-name>ProductBeanRO</ejb-name>
     ...
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <reentrant>False</reentrant>
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>ProductRO</abstract-schema-name>
      <cmp-field><field-name>productNo</field-name></cmp-field>
      <cmp-field><field-name>name</field-name></cmp-field>
     ...
      <primkey-field>productNo</primkey-field>
      <query>
        <query-method>
          <method-name>findByCoverLocation</method-name>
          <method-params>
            <method-param>java.lang.String</method-param>
          </method-params>
        </query-method>
        <ejb-ql>
           SELECT OBJECT(p)
             FROM ProductRO p
            WHERE p.coverLocation = ?1
        </ejb-ql>
      </query>
      <query>
        <query-method>
          <method-name>findBySerial</method-name>
          <method-params>
            <method-param>java.lang.Integer</method-param>
          </method-params>
        </query-method>
        <ejb-ql>
           SELECT OBJECT(p)
             FROM Product p,
                  ProductSerial ps
            WHERE ps.serialNo = ?1
              AND ps.productNo = p.productNo
        </ejb-ql>
      </query>
      <ejb-local-ref>
        <ejb-ref-name>local/ProductBeanRO</ejb-ref-name>
        <ejb-ref-type>Entity</ejb-ref-type>
       ...
        <ejb-link>ProductBeanRO</ejb-link>
      </ejb-local-ref>
    </entity>

jboss.xml:
  <defaults>
    <datasource>java:/PostgresDS</datasource>
    <datasource-mapping>PostgreSQL</datasource-mapping>
    <debug>true</debug>
    <create-table>false</create-table>
    <remove-table>false</remove-table>
    <read-only>false</read-only>
    <time-out>60</time-out>
    <select-for-update>false</select-for-update>
    <pk-constraint>false</pk-constraint>
  </defaults>
  ...
      <entity>
         <ejb-name>ProductBeanRO</ejb-name>
         <local-jndi-name>local/ProductBeanRO</local-jndi-name>
         <read-only>true</read-only>
      </entity>

jbosscmp-jdbc.xml:
    <entity>
      <ejb-name>ProductBeanRO</ejb-name>
      <table-name>product</table-name>
      <read-only>true</read-only>
      <read-time-out>5000</read-time-out>
      <cmp-field>
        <field-name>productNo</field-name>
        <column-name>product_no</column-name>
      </cmp-field>
     ...
      <load-groups>
        <load-group>
          <load-group-name>dvdInfo</load-group-name>
          <field-name>shortName</field-name>
          <field-name>name</field-name>
          <field-name>manufacturerNo</field-name>
          <field-name>thumbnailUrl</field-name>
        </load-group>
        <load-group>
          <load-group-name>dvdDetailInfo</load-group-name>
          <field-name>imageUrl</field-name>
          <field-name>backImageUrl</field-name>
          <field-name>largeImageUrl</field-name>
          <field-name>largeBackImageUrl</field-name>
        </load-group>
      </load-groups>
      <eager-load-group>dvdInfo</eager-load-group>
      <lazy-load-groups>
        <lazy-load-group>dvdInfo</lazy-load-group>
        <lazy-load-group>dvdDetailInfo</lazy-load-group>
      </lazy-load-groups>
    </entity>



-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to