code: public void synchTransaction(SimpleFeatureStore featureStore) {
  		// check if transaction is active, otherwise do nothing (auto-commit mode)
  		if (TransactionSynchronizationManager.isActualTransactionActive()) {
  			DataAccess<SimpleFeatureType, SimpleFeature> dataStore = featureStore.getDataStore();
  			if (!transactions.containsKey(dataStore)) {
  				Transaction transaction = null;
  				if (dataStore instanceof JDBCDataStore) {
  					JDBCDataStore jdbcDataStore = (JDBCDataStore) dataStore;
  					transaction = jdbcDataStore.buildTransaction(DataSourceUtils
  							.getConnection(jdbcDataStore.getDataSource()));
  				} else {
  					transaction = new DefaultTransaction();
  				}
  				transactions.put(dataStore, transaction);
  			}
  			featureStore.setTransaction(transactions.get(dataStore));
  		}
  	}
docs: Synchronize the geotools transaction with the platform transaction, if such a transaction is active.
  
  @param featureStore
  @param dataSource