code: @Override
  	public void afterCompletion(int status) {
  		// clean up transactions that aren't managed by Spring
  		for (DataAccess<SimpleFeatureType, SimpleFeature> dataStore : transactions.keySet()) {
  			// we must manage transaction ourselves for non-JDBC !
  			if (!(dataStore instanceof JDBCDataStore)) {
  				Transaction transaction = transactions.get(dataStore);
  				try {
  					switch (status) {
  						case TransactionSynchronization.STATUS_COMMITTED:
  							transaction.commit();
  							break;
  						case TransactionSynchronization.STATUS_ROLLED_BACK:
  							transaction.rollback();
  							break;
  						case TransactionSynchronization.STATUS_UNKNOWN:
  					}
  				} catch (IOException e) {
  					try {
  						transaction.rollback();
  					} catch (IOException e1) {
  						log.debug("Could not rollback geotools transaction", e1);
  					}
  				} finally {
  					try {
  						transaction.close();
  					} catch (IOException e) {
  						log.debug("Could not close geotools transaction", e);
  					}
  				}
  			}
  		}
  		transactions.clear();
  	}
docs: Called when the transaction manager has committed/rolled back. We should copy this behavior at the geotools
  level, except for the JDBC case, which has already been handled.