[ 
http://jira.jboss.com/jira/browse/JBAS-1386?page=comments#action_12315231 ]
     
Peter Doornbosch commented on JBAS-1386:
----------------------------------------

Alexey, I don't understand your comment about "no connection". I wonder..., are 
we looking at different code, or what?
The following code is copied from jboss-4.0.1 source; it is the inner class 
FieldState from JDBCCMP1xFieldBridge. From this i conclude that FieldState is 
linked with EntityState and, moreover, that all its methods delegate to 
EntityState. ?

   private class FieldState
   {
      private Object originalValue;
      private long lastRead = -1;
      private JDBCEntityBridge.EntityState entityState;

      public FieldState(JDBCContext jdbcContext)
      {
         this.entityState = jdbcContext.getEntityState();
      }

      public boolean isLoaded()
      {
         return entityState.isLoaded(tableIndex);
      }

      public void setLoaded()
      {
         entityState.setLoaded(tableIndex);
      }

      public void setCheckDirty()
      {
         entityState.setCheckDirty(tableIndex);
      }
   }

> commit option B does not work with CMP 1.x
> ------------------------------------------
>
>          Key: JBAS-1386
>          URL: http://jira.jboss.com/jira/browse/JBAS-1386
>      Project: JBoss Application Server
>         Type: Bug
>   Components: CMP service
>     Versions: JBossAS-4.0.1 Final
>  Environment: jdk 1.4.2 on linux
>     Reporter: Peter Doornbosch
>     Assignee: Alexey Loubyansky
>  Attachments: employee-ejb.jar
>
>
> When accessing a CMP 1.x entity bean with the commit option set to B, and the 
> bean is already loaded (by a previous invocation), the bean is not loaded 
> again from the database (as it should with commit option B). This can be 
> easily verified by deploying such a bean and enabling sql logging. 
> The cause of this bug is in the following method from JDBCCMP1xFieldBridge:
>    public void resetPersistenceContext(EntityEnterpriseContext ctx)
>    {
>       if(isReadTimedOut(ctx))
>       {
>          JDBCContext jdbcCtx = (JDBCContext)ctx.getPersistenceContext();
>          jdbcCtx.setFieldState(jdbcContextIndex, new FieldState(jdbcCtx));
>       }
>    }
> Assigning a 'new FieldState(jdbcCtx)' to the jdbcCtx effectively does 
> nothing, because JDBCCMP1xFieldBridge.FieldState delegates to EntityState and 
> the EntityState is not affected by this call.  Hence, after this method, the 
> state of the field is still "loaded", and thus this field is not part of the 
> load-iterator created by JDBCEntityBridge.
> I think the fix is rather easy: just reset the field flags explicitely (as it 
> is done in the cmp 2.x case), e.g.
> jdbcCtx.getEntityState().resetFlags(tableIndex);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to