Bugs item #925133, was opened at 2004-03-29 07:40
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=925133&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Mark Brodziak (brodziakm)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Read-only entity fails to load.

Initial Comment:
Operating System: Windows XP
JDK Version: 1.4.2
JBoss Version: JBoss 3.2.3

I am using a set of read-only entity beans. This EJB 
package deploys and executes correctly under JBoss 
3.2.1 (and 3.2.0RC3).

Under JBoss 3.2.3 the attached exception trace occurs.

The following forum entry (on JBoss.org) indicates that 
this problem was resolved earlier; it appears to have 
been re-introduced.

http://www.jboss.org/index.html?
module=bb&op=viewtopic&t=22204

I believe that the issue relates to the handling of read-
only fields; I believe that they are being incorrectly 
optimised out of the SQL, and hence not loaded.

To reproduce the bug:
1. Define a read-only entity bean. In my case the entity 
contains only 2 fields: key and description, which are 
both read-only.
2. Deploy the EJB.
3. Attempt to access the EJB. The exception trace 
should occur.

----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-08-08 17:45

Message:
Logged In: YES 
user_id=543482

Can't reproduce with 3.2.6rc2.

----------------------------------------------------------------------

Comment By: Mark Brodziak (brodziakm)
Date: 2004-04-01 04:29

Message:
Logged In: YES 
user_id=728247

A quick note:

We are using XDoclet to generate classes and XML 
descriptors. The entities have been set to 'read-only' in the 
source XDoclet tags. 

Because we have a -lot- of classes under source control, we 
updated our build script to strip the '<read-only>true</read-
only> from the file 'jbosscmp-jdbc.xml' from each CMP field. 
Note that this is NOT the jboss.xml, which -still- contains the 
<read-only>true</read-only> tag (as per my example). 

My sincere apologies if I misrepresented this earlier.

So to summarise:
 - When entities are set to read-only in jboss.xml and their 
fields are set to read-only in jbosscmp-jdbc.xml, they fail to 
work under JBoss 3.2.3
 - When entities are set to read-only in jboss.xml and their 
fields are not set to read-only in jbosscmp-jdbc.xml, they 
work correctly under JBoss 3.2.3

----------------------------------------------------------------------

Comment By: Mark Brodziak (brodziakm)
Date: 2004-03-30 04:27

Message:
Logged In: YES 
user_id=728247

Attached is a simple packaged entity (Country codes / 
descriptions) and corresponding service bean that replicates 
the problem.

When the read-only attribute is enabled for the entity in 
jboss.xml, the following debug output is displayed:

  DEBUG [CountryCode#findAll] Executing SQL: SELECT 
t0_e.CODE FROM V_COUNTRY_CODE1 t0_e
  DEBUG [LogInterceptor] Invoke: [[.4.]] getCountryCode()
09:06:16,640 DEBUG [LogInterceptor] Invoke: [[.4.]] 
getDescription()
  ERROR [LogInterceptor] EJBException:
javax.ejb.EJBException: Could not load field value: description

After the read-only attribute is changed (and this is the only 
change), the following output appears:

  DEBUG [CountryCode#findAll] Executing SQL: SELECT 
t0_e.CODE FROM V_COUNTRY_CODE1 t0_e
  DEBUG [LogInterceptor] Invoke: [[.4.]] getCountryCode()
  DEBUG [CountryCode] Executing SQL: SELECT DESCRIPTION 
FROM V_COUNTRY_CODE1 WHERE (CODE=?)
  DEBUG [LogInterceptor] Invoke: [[.4.]] getDescription()
  DEBUG [LogInterceptor] Invoke: [[.8.]] getCountryCode()
  DEBUG [CountryCode] Executing SQL: SELECT DESCRIPTION 
FROM V_COUNTRY_CODE1 WHERE (CODE=?)
  DEBUG [LogInterceptor] Invoke: [[.8.]] getDescription()
  DEBUG [LogInterceptor] Invoke: [[.10.]] getCountryCode()
  DEBUG [CountryCode] Executing SQL: SELECT DESCRIPTION 
FROM V_COUNTRY_CODE1 WHERE (CODE=?)
  DEBUG [LogInterceptor] Invoke: [[.10.]] getDescription()
  DEBUG [LogInterceptor] Invoke: [[.12.]] getCountryCode()
etc...

Further information:

Database type: Oracle 9i
Data source name: 'Report Server'
Table (or view) name: V_COUNTRY_CODE1
Columns: CODE number(5), DESCRIPTION varchar2(25)
Caching strategy: as follows (from standardjboss.xml)

<container-configuration>
  <container-name>MASS Read Only CMP 2.x 
EntityBean</container-name>
  <call-logging>false</call-logging>
  <sync-on-commit-only>false</sync-on-commit-only>
  <container-interceptors>
    
<interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderIntercep
tor</interceptor>
    
<interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor
>
    
<interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interc
eptor>
    
<interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interce
ptor>
    <interceptor 
metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor
</interceptor>
    
<interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</i
nterceptor>
    
<interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</inte
rceptor>
    
<interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</
interceptor>
    
<interceptor>org.jboss.ejb.plugins.EntityReentranceIntercepto
r</interceptor>
    
<interceptor>org.jboss.resource.connectionmanager.CachedCo
nnectionInterceptor</interceptor>
    
<interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterc
eptor</interceptor>
    
<interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInter
ceptor</interceptor>
  </container-interceptors>
  <instance-
pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
  <instance-
cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</i
nstance-cache>
  <persistence-
manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</p
ersistence-manager>
  <transaction-
manager>org.jboss.tm.TxManager</transaction-manager>
  <locking-
policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</lo
cking-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>7200</optiond-refresh-rate>
</container-configuration>

----------------------------------------------------------------------

Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-03-29 12:21

Message:
Logged In: YES 
user_id=543482

Following these steps I don't see any problem.

      Collection col = BUtil.getLocalHome().findAll();
      for(Iterator iter = col.iterator(); iter.hasNext();)
      {
         BLocal b = (BLocal)iter.next();
         log.debug("b.getName(): " + b.getName());
      }

where name is a read-only in jbosscmp-jdbc.xml cmp-field.

Could you please provide more details or a testcase?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=925133&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to