db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David.Cor...@equifax.com
Subject Re: ObjectEnvelope.commit
Date Fri, 09 May 2003 14:33:06 GMT

I did take a look, and it's very scary.  The failure to do anything at all
for collections is bothersome ( I understand that it's hard, that's why i
figured they'd just be flushed out of the cache).

David



|---------+--------------------------->
|         |           Thomas Mahler   |
|         |           <thma32@web.de> |
|         |           Sent by:        |
|         |           thma32@web.de   |
|         |                           |
|         |                           |
|         |           05/09/2003 02:01|
|         |           AM              |
|         |           Please respond  |
|         |           to "OJB         |
|         |           Developers List"|
|         |                           |
|---------+--------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                                                           |
  |        To:      OJB Developers List <ojb-dev@db.apache.org>                    
                                                                 |
  |        cc:                                                                           
                                                           |
  |        Subject: Re: ObjectEnvelope.commit                                            
                                                           |
  |                                                                                      
                                                           |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|



Hi David,

Have a look at ObjectENvelope.rollback:
     public void rollback()
     {
             if(myObj != null && beforeImage != null)
             {
                                     ClassDescriptor mif =
tx.getBroker().getClassDescriptor(getObject().getClass());
                                     /**
                                      * Set all the field values back.
                                      */
                                     FieldDescriptor[] fieldDescs =
mif.getFieldDescriptions();
                                     for (int i = 0; i < fieldDescs.length;
i++)
                                     {
                                                  FieldDescriptor fd =
fieldDescs[i];
                                                  PersistentField f =
fd.getPersistentField();

                                                  Object value =
beforeImage.get(fd.getColumnName());

                                                  f.set(myObj, value);
                                     }

This method is being called from the rollback method of the
ModificationStates.
Currently it's only called from StateOldDirty. I think we have to think
a bit if it is required to call it in other states too.

cheers,
Thomas

David.Corbin@equifax.com wrote:
> I guess that makes sense.  Can you point me at where the attribute values
> are rolled back in the code?
>
> David
>
>
>
> |---------+--------------------------->
> |         |           Thomas Mahler   |
> |         |           <thma32@web.de> |
> |         |           Sent by:        |
> |         |           thma32@web.de   |
> |         |                           |
> |         |                           |
> |         |           05/08/2003 02:21|
> |         |           AM              |
> |         |           Please respond  |
> |         |           to "OJB         |
> |         |           Developers List"|
> |         |                           |
> |---------+--------------------------->
>   >
--------------------------------------------------------------------------------------------------------------------------------------------------|

>   |
|
>   |        To:      OJB Developers List <ojb-dev@db.apache.org>
|
>   |        cc:
|
>   |        Subject: Re: ObjectEnvelope.commit
|
>   |
|
>   >
--------------------------------------------------------------------------------------------------------------------------------------------------|

>
>
>
> Hi David,
>
> We are not removing objects from the cache during rollback, right.
> But we are rolling back the attribute values back to the image of the
> object when first locked to the tx.
>
> Only deleted objects are removed from the cache.
>
> cheers,
> Thomas
>
> David.Corbin@equifax.com wrote:
>
>>I noticed in ObjectEnvelope, that commit method doesn't do anything to
>
> the
>
>>cache in the event of an exception.  Is this handled at a lower level
>>somehow?  What I'm concerned about, is the case where Transaction has a
>>handful of writes.  Some of these go through OK, but one of them fails
>
> for
>
>>some reason.  I know the rollback happens in the database, but does the
>>cache now reflect data that is an incorrect representation of the
>
> database?
>
>>David
>>
>>
>>This message contains information from Equifax Inc. which may be
>>confidential and privileged.  If you are not an intended recipient,
>
> please
>
>>refrain from any disclosure, copying, distribution or use of this
>>information and note that such actions are prohibited.  If you have
>>received this transmission in error, please notify by e-mail
>>postmaster@equifax.com.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org







Mime
View raw message