Hi all,

I have modifieed my beans as follows in the deployment descriptor 
(jboss.xml):

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

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

I also switched to commit option 'A', because the container is the only 
application modifying the database data:

<container-configurations>
   <container-configuration extends="Standard CMP 2.x EntityBean">
        <container-name>CMP 2.x and Cache</container-name>
        <commit-option>A</commit-option>
   </container-configuration>
</container-configurations>


I turned on DEBUG info on (org.jboss.ejb.plugins.cmp) using the log4j.xml 
file, so I can see the SQL generated:

 <!-- print cmp debug messages -->
 <category name="org.jboss.ejb.plugins.cmp">
     <priority value="DEBUG"/>
 </category>


Then I my application. On each invocation of my methods I still see the 
following SQL generated:

15:29:08,938 DEBUG [Relation#findByPrimaryKey] Executing SQL: SELECT 
relationId FROM Relation WHERE relationId=?
15:29:08,942 DEBUG [Relation#findByPrimaryKey] Executing SQL: SELECT 
relationId FROM Relation WHERE relationId=?
15:29:08,947 DEBUG [Relation#findByPrimaryKey] Executing SQL: SELECT 
relationId FROM Relation WHERE relationId=?
15:29:08,951 DEBUG [Relation#findByPrimaryKey] Executing SQL: SELECT 
relationId FROM Relation WHERE relationId=?

As you can see this is a finder method which does no database modifying 
what so ever. 
So I assumed JBoss could get this from cache. Why is this SQL still 
required? 

Thanks a lot,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands






-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to