Project

General

Profile

« Previous | Next » 

Revision 54d2eeaf

Added by Andreas Müller almost 6 years ago

ref #7357 fix TaxonName.clone test in model

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/ResultSetPartitioner.java
121 121
	 * @param partitionedIO
122 122
	 */
123 123
	public void doPartition(IPartitionedIO<STATE> partitionedIO, STATE state) {
124
		try{
124
		int i = 0;
125
	    try{
125 126
			profiler.startTx();
126 127
			TransactionStatus txStatus = getTransaction(partitionSize, partitionedIO);
127 128

  
129
			i = 1;
128 130
			state.makeTransactionalSourceReference(partitionedIO.getReferenceService());
129 131

  
130 132
			profiler.startRs();
131 133
			ResultSet rs = makePartitionResultSet();
132

  
134
            i = 2;
133 135
			profiler.startRelObjects();
134 136
			this.relatedObjects = partitionedIO.getRelatedObjectsForPartition(rs, state);
135
			state.setRelatedObjects(relatedObjects);
136

  
137
            i = 3;
138
            state.setRelatedObjects(relatedObjects);
139
            i = 4;
137 140
			profiler.startRs2();
138 141
			partitionResultSet = makePartitionResultSet();
139

  
142
            i = 5;
140 143
			profiler.startDoPartition();
141 144
			partitionedIO.doPartition(this, state);
142

  
145
            i = 6;
143 146
			profiler.startDoCommit();
144 147
			partitionedIO.commitTransaction(txStatus);
145 148
			state.resetTransactionalSourceReference();
146

  
149
            i = 7;
147 150
			profiler.end();
148 151
			state.setRelatedObjects(null);
149

  
152
            i = 8;
150 153
			logger.info("Saved " + getCurrentNumberOfRows() + " " + partitionedIO.getPluralString() );
151 154
			profiler.print();
152 155
		}catch(Exception e){
153
			String message = "Exception (%s) occurred while handling import partition for %s.";
154
			message = String.format(message, e.getLocalizedMessage(), partitionedIO.getPluralString());
156
			String message = "Exception (%s) occurred at position " + i + " while handling import partition for %s.";
157
			message = String.format(message, e.getMessage(), partitionedIO.getPluralString());
158
			e.printStackTrace();
155 159
			throw new RuntimeException(message, e);
156 160
		}
157 161
	}

Also available in: Unified diff