Revision 47328
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/DefaultTransaction.java | ||
---|---|---|
93 | 93 |
throw new IllegalStateException("Can't commit transaction without begin."); |
94 | 94 |
} |
95 | 95 |
for (Pair<DataStore, Boolean> item : stores.values()) { |
96 |
DataStore store = item.getLeft();
|
|
96 |
DataStore store = getStore(item);
|
|
97 | 97 |
if( store instanceof FeatureStore ) { |
98 | 98 |
FeatureStore fstore = (FeatureStore) store; |
99 | 99 |
if( fstore!=null && fstore.getMode() != MODE_QUERY) { |
... | ... | |
116 | 116 |
} |
117 | 117 |
|
118 | 118 |
for (Pair<DataStore, Boolean> item : stores.values()) { |
119 |
DataStore store = item.getLeft();
|
|
119 |
DataStore store = getStore(item);
|
|
120 | 120 |
if( store instanceof FeatureStore ) { |
121 | 121 |
FeatureStore fstore = (FeatureStore) store; |
122 | 122 |
if( fstore.getMode() != MODE_QUERY) { |
... | ... | |
161 | 161 |
if( StringUtils.isBlank(id) ) { |
162 | 162 |
theId = store.hashCode() + "@"+ store.getFullName(); |
163 | 163 |
} else { |
164 |
DataStore theStore = this.stores.get(theId).getLeft();
|
|
164 |
DataStore theStore = getStore(this.stores.get(theId));
|
|
165 | 165 |
if(theStore!=null ){ |
166 | 166 |
if( theStore==store ) { |
167 | 167 |
return; |
... | ... | |
180 | 180 |
|
181 | 181 |
@Override |
182 | 182 |
public FeatureStore getFeatureStore(String id) { |
183 |
return (FeatureStore) this.stores.get(id);
|
|
183 |
return (FeatureStore) this.getStore(this.stores.get(id));
|
|
184 | 184 |
} |
185 | 185 |
|
186 | 186 |
@Override |
... | ... | |
239 | 239 |
} |
240 | 240 |
String id = null; |
241 | 241 |
for (Map.Entry<String, Pair<DataStore,Boolean>> entry : this.stores.entrySet()) { |
242 |
if( store == entry.getValue().getLeft() ) {
|
|
242 |
if( store == getStore(entry.getValue()) ) {
|
|
243 | 243 |
id = entry.getKey(); |
244 | 244 |
break; |
245 | 245 |
} |
... | ... | |
287 | 287 |
this.rollbackQuietly(); |
288 | 288 |
} |
289 | 289 |
for (Pair<DataStore, Boolean> item : stores.values()) { |
290 |
DataStore store = item.getLeft();
|
|
290 |
DataStore store = getStore(item);
|
|
291 | 291 |
if( store instanceof SupportTransactions ) { |
292 | 292 |
((SupportTransactions) store).setTransaction(null); |
293 | 293 |
} |
... | ... | |
370 | 370 |
@Override |
371 | 371 |
public boolean contains(DataStore store) { |
372 | 372 |
for (Pair<DataStore, Boolean> item : stores.values()) { |
373 |
DataStore value = item.getLeft();
|
|
373 |
DataStore value = getStore(item);
|
|
374 | 374 |
if(store == value){ |
375 | 375 |
return true; |
376 | 376 |
} |
377 | 377 |
} |
378 | 378 |
return false; |
379 | 379 |
} |
380 |
|
|
381 |
private DataStore getStore(Pair<DataStore, Boolean> item) { |
|
382 |
if( item == null ) { |
|
383 |
return null; |
|
384 |
} |
|
385 |
return item.getLeft(); |
|
386 |
} |
|
387 |
|
|
380 | 388 |
} |
Also available in: Unified diff