code: private ComponentInstance createUnitInstance(Persistence.PersistenceUnit unit) throws MissingHandlerException,
              UnacceptableConfiguration, ConfigurationException {
          LOGGER.info("Creating persistence unit instance for unit {}", unit.getName());
          Dictionary<String, Object> configuration = new Hashtable<>();
          configuration.put("bundle", this);
          configuration.put("unit", unit);
          Dictionary<String, String> filters = new Hashtable<>();
          if (!Strings.isNullOrEmpty(unit.getJtaDataSource())) {
              filters.put("jta-ds", createDataSourceFilter(unit.getJtaDataSource()));
              filters.put("ds", createDataSourceFilter(unit.getJtaDataSource()));
          }
          if (! Strings.isNullOrEmpty(unit.getNonJtaDataSource())) {
              filters.put("ds", createDataSourceFilter(unit.getNonJtaDataSource()));
              if (filters.get("jta-ds") == null) {
                  filters.put("jta-ds", createDataSourceFilter(unit.getNonJtaDataSource()));
              }
          }
          configuration.put("requires.filters", filters);
          LOGGER.info("Creating persistence unit instance for unit {} : {}", unit.getName(), configuration);
          return factory.createComponentInstance(configuration);
      }
docs: Creates the component instance for the given unit.
  This function computes the filters to retrieve the data sources. If a data source is not set in inject a
  filter that will never match.
  
  @param unit the persistence unit
  @return the created instance
  @throws MissingHandlerException   the instance cannot be created because of a missing handler
  @throws UnacceptableConfiguration the configuration if invalid.
  @throws ConfigurationException    the configuration is rejected.