Changeset 2010


Ignore:
Timestamp:
07/16/09 23:03:19 (3 years ago)
Author:
mswertz
Message:

BUGFIX: update of file attachments in mappers resulted in endless loop

Location:
molgenis3_3/src/org/molgenis/framework/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • molgenis3_3/src/org/molgenis/framework/data/MappingDecorator.java

    r1978 r2010  
    1717public class MappingDecorator<E extends Entity> implements JDBCMapper<E> 
    1818{ 
    19         private JDBCMapper<E> mapper; 
     19        protected JDBCMapper<E> mapper; 
    2020 
    2121        public MappingDecorator(JDBCMapper<E> generatedMapper) 
  • molgenis3_3/src/org/molgenis/framework/data/jdbc/AbstractJDBCMapper.java

    r2000 r2010  
    7575                                List<E> sublist = entities.subList(i, endindex); 
    7676                                updatedRows += Math.max(this.executeAdd(sublist), superUpdatedRows); 
    77  
    78                                 // update any mrefs for this entity 
    79                                 this.storeMrefs(entities); 
    80  
    81                                 // store file attachments and then update the file paths to them 
    82                                 if (this.saveFileAttachements(entities, database.fileSource)) 
    83                                 { 
    84                                         this.update(sublist); 
    85                                 } 
     77                        } 
     78                         
     79                        // update any mrefs for this entity 
     80                        this.storeMrefs(entities); 
     81                         
     82                        // store file attachments and then update the file paths to them 
     83                        if (this.saveFileAttachements(entities, database.fileSource)) 
     84                        { 
     85                                this.update(entities); 
    8686                        } 
    8787 
     
    167167                                List<E> sublist = entities.subList(i, endindex); 
    168168 
     169                                //put the files in their place 
     170                                this.saveFileAttachements(sublist, database.fileSource); 
     171                                 
    169172                                updatedRows += Math.max(this.executeUpdate(sublist), superUpdatedRows); 
    170  
    171                                 // rename file attachments with right name and update database 
    172                                 this.storeMrefs(entities); 
    173                                 if (this.saveFileAttachements(entities, database.fileSource)) 
    174                                 { 
    175                                         this.update(sublist); 
    176                                 } 
    177                         } 
     173                        } 
     174                         
     175                        // rename file attachments with right name and update database 
     176                        this.storeMrefs(entities); 
    178177 
    179178                        database.commitPrivateTx(TX_TICKET); 
Note: See TracChangeset for help on using the changeset viewer.