batchUpdateForSameSourceAttribute End -----------------------------------------------------------------------------------------------------------
503064
protected void zBulkInsertListForSameSourceAttribute(List listToInsert, DatabaseType databaseType, Object source) throws MithraDatabaseException
    {
        TimeZone databaseTimeZone = this.getDatabaseTimeZoneGenericSource(source);

        String schema = getSchemaForBulkInsert(databaseType, source);

        BulkLoader bulkLoader = null;

        Connection con = null;
        Statement stm = null;
        try
        {
            con = this.getConnectionForWriteGenericSource(source);
            String fullyQualifiedTableName = this.getFullyQualifiedTableNameGenericSource(source);
            String tableName = this.getTableNameGenericSource(source);
            bulkLoader = this.createBulkLoaderGenericSource(source);
            boolean createsTempTable = bulkLoader.createsTempTable();
            String tempTableName = null;
            String fullyQualifiedTempTableName = null;
            if (createsTempTable)
            {
                String tableNamePrefix = this.getTableNamePrefixGenericSource(source);
                tempTableName = assignTempTableName(tableNamePrefix);
                String tempDbSchemaName = databaseType.getTempDbSchemaName();
                if (tempDbSchemaName == null)
                {
                    tempDbSchemaName = schema;
                }
                fullyQualifiedTempTableName = databaseType.getFullyQualifiedTableName(tempDbSchemaName, tempTableName);
            }
            Logger sqlLogger = this.getSqlLogger();
            bulkLoader.initialize(databaseTimeZone, schema, tableName,
                    this.getMithraObjectPortal().getFinder().getPersistentAttributes(),
                    sqlLogger, tempTableName, this.getColumnsForBulkInsertCreation(databaseType), con);
            if (createsTempTable)
            {
                MithraManagerProvider.getMithraManager().getCurrentTransaction().registerSynchronization(createDropBulkTempTableSynchronization(source, tempTableName));
            }
            bulkLoader.bindObjectsAndExecute(listToInsert, con);
            bulkLoader.destroy();
            bulkLoader = null;
            if (createsTempTable)
            {
                String sql = "insert into " + fullyQualifiedTableName + " select * from " + fullyQualifiedTempTableName;
                if (sqlLogger.isDebugEnabled())
                {
                    sqlLogger.debug("Batch inserting with temp table, " + listToInsert.size() + " rows: " + sql);
                }
                stm = con.createStatement();
                this.setExpectedExecuteReturn(listToInsert.size());
                int inserted = stm.executeUpdate(sql);
                stm.close();
                stm = null;
                if (inserted < listToInsert.size())
                {
                    throw new MithraDatabaseException("bulk insert did not insert the correct number of rows. Expected " + listToInsert.size() +
                            " but got " + inserted);
                }
            }
            zRegisterForNotification(listToInsert, source);
        }
        catch (SQLException e)
        {
            this.analyzeAndWrapSqlExceptionGenericSource("bulk insert failed " + e.getMessage(), listToInsert, e, source, con);
        }
        catch (BulkLoaderException e)
        {
            throw new MithraDatabaseException("bulk insert failed " + e.getMessage(), e);
        }
        finally
        {
            if (bulkLoader != null) bulkLoader.destroy();
            this.closeStatementAndConnection(con, stm);
        }
    }
664060
public void serializeInsert(QueryMetadata metadata, RelationalPath<?> entity,
                                List<SQLInsertBatch> batches, SQLSerializer context) {
        context.serializeForInsert(metadata, entity, batches);

        if (!metadata.getFlags().isEmpty()) {
            context.serialize(Position.END, metadata.getFlags());
        }
    }
451713
private void updateAttributes(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException
   {
      String name = request.getParameter("name");

      if (trace)
         log.trace("updateAttributes, name=" + name);

      Enumeration paramNames = request.getParameterNames();
      HashMap<String, String> attributes = new HashMap<String, String>();

      while (paramNames.hasMoreElements())
      {
         String param = (String)paramNames.nextElement();

         if (param.equals("name") || param.equals("action"))
            continue;

         String value = request.getParameter(param);

         if (trace)
            log.trace("name=" + param + ", value='" + value + "'");

         // Ignore null values, these are empty write-only fields
         if (value == null || value.length() == 0)
            continue;

         attributes.put(param, value);
      }

      try
      {
         AttributeList newAttributes = setAttributes(name, attributes);
         MBeanData data = getMBeanData(name);
         request.setAttribute("mbeanData", data);

         RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/inspectmbean.jsp");
         rd.forward(request, response);
      }
      catch (Exception e)
      {
         throw new ServletException("Failed to update attributes", e);
      }
   }
428540
public function batchUpdate()
    {
        if ($this->_entityName === null) {
            throw new \Exception('Please call « handleEntity(ClassMetadata $class) » before using this handler');
        }
        if (!$this->truncateTable()) {
            throw new \Exception('Could not truncate table ' . $this->getSearchIndexTable());
        }
        $em = $this->_em;
        $indexClass = $this->getSearchIndexClass();

        $batchSize = 100;
        $offset = 0;
        $query = $this->_em->createQueryBuilder()
            ->select('o')
            ->from($this->_entityName, 'o')
            ->setMaxResults($batchSize);

        do {
            $query->setFirstResult($offset);
            $entities = $query->getQuery()->execute();
            foreach ($entities as $entity) {
                $fields = $this->searchIndexes[$this->_class->getName()]['fields'];
                foreach ($fields as $field) {
                    $keywords = $entity->analyseField($field);
                    foreach ($keywords as $keyword) {
                        $index = new $indexClass();
                        $index->setObject($entity);
                        $index->setField($field);
                        $index->setKeyword($keyword);
                        $em->persist($index);
                    }
                }
            }

            $em->flush();
            $offset += $batchSize;
        } while (count($entities) > 0);
    }
946752
private void consumeCompaction(CompactionUpdateBatch updateBatch) throws Exception {
        int ignoreCount = 0;
        int updateCount = updateBatch.size();
        int totalIgnoreBytes = 0;
        int totalUpdateBytes = updateBatch.getDataSizeTotal();
        
        /* Using lwMark is to guarantee that redo logs from compaction will not increase
         * the hwMark of the underlying array file. If hwMark is being used, the current
         * redo entry is discarded upon crash. Upon restart, the hwMark from the underlying
         * array file may prevent updates in the lost redo entry from being resent.   
         */
        long updateScn = _addressArray.getLWMark();
        Segment segTarget = updateBatch.getTargetSegment();
        
        for(int i = 0; i < updateCount; i++) {
            int index = updateBatch.getUpdateIndex(i);
            long origAddr = updateBatch.getOriginDataAddr(i);
            long currAddr = getAddress(index);
            
            if(currAddr == 0 ||      /* data at the given index is deleted by writer */ 
               currAddr != origAddr  /* data at the given index is updated by writer */) {
                /*
                 * The address generated by the compactor is obsolete.
                 */
                int updateBytes = updateBatch.getUpdateDataSize(i);
                totalIgnoreBytes += updateBytes;
                ignoreCount++;
            } else {
                /*
                 * The address generated by the compactor has not been touched by the writer.
                 * Update the address array directly.
                 */ 
                setCompactionAddress(index, updateBatch.getUpdateDataAddr(i), updateScn);
            }
        }
        
        int consumeCount = updateCount - ignoreCount;
        int totalConsumeBytes = totalUpdateBytes - totalIgnoreBytes;
        
        if(_log.isTraceEnabled()) {
            _log.trace("consumed compaction batch " +
                       updateBatch.getDescriptiveId() +
                       " updates " + consumeCount + "/" + updateCount +
                       " bytes " + totalConsumeBytes + "/" + totalUpdateBytes);
        }
        
        // Update segment load size
        segTarget.decrLoadSize(totalIgnoreBytes);
    }
436061
@Override
	public int update(FeatureTileLink data) throws SQLException {

		UpdateBuilder<FeatureTileLink, FeatureTileLinkKey> ub = updateBuilder();
		// Currently there are no non primary values to update

		ub.where()
				.eq(FeatureTileLink.COLUMN_FEATURE_TABLE_NAME,
						data.getFeatureTableName())
				.and()
				.eq(FeatureTileLink.COLUMN_TILE_TABLE_NAME,
						data.getTileTableName());

		PreparedUpdate<FeatureTileLink> update = ub.prepare();
		int updated = update(update);

		return updated;
	}
1203891
function handleResourceContext(attrNode, context) {
    let dataSource;
    let lastDataSourceName;

    const errorContext = context.errorContext;

    if (attrNode.resource) {
        if ('subFilters' in attrNode) {
            throw new ImplementationError(
                'Adding subFilters for included sub-resource is not allowed' + context.errorContext
            );
        }
        if ('primaryKey' in attrNode) {
            throw new ImplementationError(
                'Overwriting primaryKey for included sub-resource is not allowed' + context.errorContext
            );
        }
    } else if (!('primaryKey' in attrNode)) {
        throw new ImplementationError('Missing primaryKey' + context.errorContext);
    }

    if (attrNode.dataSources) {
        Object.keys(attrNode.dataSources).forEach(dataSourceName => {
            lastDataSourceName = dataSourceName;
            context.dataSourceAttributes[dataSourceName] = [];

            dataSource = attrNode.dataSources[dataSourceName];

            if (dataSource.inherit) {
                if (!attrNode.resource) {
                    throw new ImplementationError(
                        `DataSource "${dataSourceName}" is defined as "inherit" but has no included resource`
                    );
                }
                context.errorContext = ' in inherit' + errorContext;
                dataSource.inherit = checkWhitelist(dataSource.inherit, ['true', 'inherit', 'replace'], context);
                if (dataSource.inherit === 'true') {
                    dataSource.inherit = 'inherit';
                }
                context.errorContext = errorContext;
            }

            if (!dataSource.type && !dataSource.inherit) {
                throw new ImplementationError(
                    `DataSource "${dataSourceName}" misses "type" option${context.errorContext}`
                );
            }

            if (dataSource.joinParentKey) {
                context.errorContext = ' in joinParentKey' + errorContext;
                dataSource.joinParentKey = parsePrimaryKey(dataSource.joinParentKey, context);
                context.errorContext = errorContext;
            }

            if (dataSource.joinChildKey) {
                context.errorContext = ' in joinChildKey' + errorContext;
                dataSource.joinChildKey = parsePrimaryKey(dataSource.joinChildKey, context);
                context.errorContext = errorContext;
            }
        });
    }

    if (attrNode.joinVia) {
        if (!attrNode.dataSources[attrNode.joinVia]) {
            throw new ImplementationError(`Unknown DataSource "${attrNode.joinVia}" in joinVia` + context.errorContext);
        } else {
            dataSource = attrNode.dataSources[attrNode.joinVia];

            if (!dataSource.joinParentKey) {
                throw new ImplementationError(
                    `DataSource "${lastDataSourceName}" misses "joinParentKey" option` + context.errorContext
                );
            }

            if (!dataSource.joinChildKey) {
                throw new ImplementationError(
                    `DataSource "${lastDataSourceName}" misses "joinChildKey" option` + context.errorContext
                );
            }
        }
    }
}
532461
private void populateResourceAssignment(Record record, ResourceAssignment assignment) throws MPXJException
   {
      //
      // Handle malformed MPX files - ensure that we can locate the resource
      // using either the Unique ID attribute or the ID attribute.
      //
      Resource resource = m_projectFile.getResourceByUniqueID(record.getInteger(12));
      if (resource == null)
      {
         resource = m_projectFile.getResourceByID(record.getInteger(0));
      }

      assignment.setUnits(record.getUnits(1));
      assignment.setWork(record.getDuration(2));
      assignment.setBaselineWork(record.getDuration(3));
      assignment.setActualWork(record.getDuration(4));
      assignment.setOvertimeWork(record.getDuration(5));
      assignment.setCost(record.getCurrency(6));
      assignment.setBaselineCost(record.getCurrency(7));
      assignment.setActualCost(record.getCurrency(8));
      assignment.setStart(record.getDateTime(9));
      assignment.setFinish(record.getDateTime(10));
      assignment.setDelay(record.getDuration(11));

      //
      // Calculate the remaining work
      //
      Duration work = assignment.getWork();
      Duration actualWork = assignment.getActualWork();
      if (work != null && actualWork != null)
      {
         if (work.getUnits() != actualWork.getUnits())
         {
            actualWork = actualWork.convertUnits(work.getUnits(), m_projectFile.getProjectProperties());
         }

         assignment.setRemainingWork(Duration.getInstance(work.getDuration() - actualWork.getDuration(), work.getUnits()));
      }

      if (resource != null)
      {
         assignment.setResourceUniqueID(resource.getUniqueID());
         resource.addResourceAssignment(assignment);
      }

      m_eventManager.fireAssignmentReadEvent(assignment);
   }
868765
void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) {

        boolean isPathEmpty = pPathStack == null || pPathStack.empty();
        String filter = pPathStack != null && !pPathStack.empty() ? pPathStack.pop() : null;
        verifyThatPathIsEmpty(pPathStack);

        JSONObject attrMap = extractData(pMBeanInfo,filter);

        if (attrMap.size() > 0) {
            pJSONObject.put(getKey(), attrMap);
        } else if (!isPathEmpty) {
            throw new IllegalArgumentException("Path given but extracted value is empty");
        }
    }
668376
protected void updateResource(Resource value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "targetPath", value.getTargetPath(), null);
      findAndReplaceSimpleElement(innerCount, root, "filtering",
               (value.isFiltering() == false) ? null : String.valueOf(value.isFiltering()), "false");
      findAndReplaceSimpleElement(innerCount, root, "directory", value.getDirectory(), null);
      findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
      findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
   }
104459
private void addCreateUpdateAttributes() throws EFapsException
    {
        final Iterator<?> iter = getType().getAttributes().entrySet().iterator();
        while (iter.hasNext()) {
            final Map.Entry<?, ?> entry = (Map.Entry<?, ?>) iter.next();
            final Attribute attr = (Attribute) entry.getValue();
            final AttributeType attrType = attr.getAttributeType();
            if (attrType.isCreateUpdate()) {
                addInternal(attr, false, (Object) null);
            }
            if (attr.getDefaultValue() != null) {
                addInternal(attr, false, attr.getDefaultValue());
            }
        }
    }
935451
private Object batchInsertAfterReordering(final String statementName,
                                              final Object parameterObject) {
        Set<String> keys = new HashSet<String>();
        keys.add(getDefaultDataSourceName());
        keys.addAll(getCobarDataSourceService().getDataSources().keySet());

        final CobarMRBase mrbase = new CobarMRBase(keys);

        ExecutorService executor = createCustomExecutorService(Runtime.getRuntime()
                .availableProcessors(), "batchInsertAfterReordering");
        try {
            final StringBuffer exceptionStaktrace = new StringBuffer();

            Collection<?> paramCollection = ((BatchInsertTask) parameterObject).getEntities();

            final CountDownLatch latch = new CountDownLatch(paramCollection.size());

            Iterator<?> iter = paramCollection.iterator();
            while (iter.hasNext()) {
                final Object entity = iter.next();
                Runnable task = new Runnable() {
                    public void run() {
                        try {
                            SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(
                                    statementName, entity);
                            if (MapUtils.isEmpty(dsMap)) {
                                logger
                                        .info(
                                                "can't find routing rule for {} with parameter {}, so use default data source for it.",
                                                statementName, entity);
                                mrbase.emit(getDefaultDataSourceName(), entity);
                            } else {
                                if (dsMap.size() > 1) {
                                    throw new IllegalArgumentException(
                                            "unexpected routing result, found more than 1 target data source for current entity:"
                                                    + entity);
                                }
                                mrbase.emit(dsMap.firstKey(), entity);
                            }
                        } catch (Throwable t) {
                            exceptionStaktrace.append(ExceptionUtils.getFullStackTrace(t));
                        } finally {
                            latch.countDown();
                        }
                    }
                };
                executor.execute(task);
            }
            try {
                latch.await();
            } catch (InterruptedException e) {
                throw new ConcurrencyFailureException(
                        "unexpected interruption when re-arranging parameter collection into sub-collections ",
                        e);
            }

            if (exceptionStaktrace.length() > 0) {
                throw new ConcurrencyFailureException(
                        "unpected exception when re-arranging parameter collection, check previous log for details.\n"
                                + exceptionStaktrace);
            }
        } finally {
            executor.shutdown();
        }

        List<ConcurrentRequest> requests = new ArrayList<ConcurrentRequest>();
        for (Map.Entry<String, List<Object>> entity : mrbase.getResources().entrySet()) {
            final List<Object> paramList = entity.getValue();
            if (CollectionUtils.isEmpty(paramList)) {
                continue;
            }

            String identity = entity.getKey();

            final DataSource dataSourceToUse = findDataSourceToUse(entity.getKey());

            final SqlMapClientCallback callback = new SqlMapClientCallback() {
                public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
                    return executor.insert(statementName, paramList);
                }
            };

            ConcurrentRequest request = new ConcurrentRequest();
            request.setDataSource(dataSourceToUse);
            request.setAction(callback);
            request.setExecutor(getDataSourceSpecificExecutors().get(identity));
            requests.add(request);
        }
        return getConcurrentRequestProcessor().process(requests);
    }
594559
function updateExistingFile(db, fileName, fileReadStream, options, cb) {
  defaultLogger.debug("In updateExistingFile");

  getFileDetails(db, {"groupId": options.groupId}, {}, function(err, fileInfo) {
    if (err) {
      defaultLogger.error(err); return cb(err);
    }
    var latestFileVersion = fileInfo.metadata.version;
    incrementFileVersion(latestFileVersion, function(newFileVersion) {
      if (!newFileVersion) {
        return cb(new Error("File version was not incremented for file " + fileName));
      }
      defaultLogger.debug("New File Version ", newFileVersion);
      createFileWithVersion(db, fileName, fileReadStream, newFileVersion, options, cb);
    });
  });
}
916910
def UpdateResourcesFromDataFile(dstpath, srcpath, type_, names=None, 
                                languages=None):
    
    src = open(srcpath, "rb")
    data = src.read()
    src.close()
    UpdateResources(dstpath, data, type_, names, languages)
1056190
def update_value_from_mapping(source_resource_attr_id, target_resource_attr_id, source_scenario_id, target_scenario_id, **kwargs):
    
    user_id = int(kwargs.get('user_id'))

    rm = aliased(ResourceAttrMap, name='rm')
    #Check the mapping exists.
    mapping = db.DBSession.query(rm).filter(
        or_(
            and_(
                rm.resource_attr_id_a == source_resource_attr_id,
                rm.resource_attr_id_b == target_resource_attr_id
            ),
            and_(
                rm.resource_attr_id_a == target_resource_attr_id,
                rm.resource_attr_id_b == source_resource_attr_id
            )
        )
    ).first()

    if mapping is None:
        raise ResourceNotFoundError("Mapping between %s and %s not found"%
                                    (source_resource_attr_id,
                                     target_resource_attr_id))

    #check scenarios exist
    s1 = _get_scenario(source_scenario_id, user_id)
    s2 = _get_scenario(target_scenario_id, user_id)

    rs = aliased(ResourceScenario, name='rs')
    rs1 = db.DBSession.query(rs).filter(rs.resource_attr_id == source_resource_attr_id,
                                    rs.scenario_id == source_scenario_id).first()
    rs2 = db.DBSession.query(rs).filter(rs.resource_attr_id == target_resource_attr_id,
                                    rs.scenario_id == target_scenario_id).first()

    #3 possibilities worth considering:
    #1: Both RS exist, so update the target RS
    #2: Target RS does not exist, so create it with the dastaset from RS1
    #3: Source RS does not exist, so it must be removed from the target scenario if it exists
    return_value = None#Either return null or return a new or updated resource scenario
    if rs1 is not None:
        if rs2 is not None:
            log.info("Destination Resource Scenario exists. Updating dastaset ID")
            rs2.dataset_id = rs1.dataset_id
        else:
            log.info("Destination has no data, so making a new Resource Scenario")
            rs2 = ResourceScenario(resource_attr_id=target_resource_attr_id, scenario_id=target_scenario_id, dataset_id=rs1.dataset_id)
            db.DBSession.add(rs2)
        db.DBSession.flush()
        return_value = rs2
    else:
        log.info("Source Resource Scenario does not exist. Deleting destination Resource Scenario")
        if rs2 is not None:
            db.DBSession.delete(rs2)

    db.DBSession.flush()
    return return_value
561284
function (context, callback) {

            var self = this,
                options = {},
                model,
                processor,
                isPatch = context.request.method === "PATCH",
                upsert = this.$resourceConfiguration.$.upsert,
                defaults;


            flow()
                .seq("collection", function (cb) {
                    self._findCollection(context, cb);
                })
                .seq(function (cb) {
                    model = this.vars.collection.createItem(self.$resourceId);
                    defaults = _.clone(model.$);
                    // check if model exists
                    if (upsert && !isPatch) {
                        cb();
                    } else {
                        model.fetch(null, cb);
                    }
                })
                .seq(function () {
                    if (!isPatch) {
                        model.clear();
                        model.set(defaults);
                    }

                    var payload = context.request.params;

                    processor = self.$restHandler.$restDataSource.getProcessorForModel(model);

                    model.set(processor.parse(model, payload || {}));

                    options.action = DataSource.ACTION.UPDATE;

                    // TODO: add hook to add session data like user id
                    if (upsert === true) {
                        options.upsert = true;
                        model.set(model.idField, model.factory.prototype.convertIdentifier(self.$resourceId));
                    }
                })
                .seq(function () {
                    self._generateAutoValues(model);
                })
                .seq(function (cb) {
                    self._validate(model, context, cb);
                })
                .seq(function (cb) {
                    self._beforeModelSave(model, context, cb);
                })
                .seq(function (cb) {
                    self._beforeModelUpdate(model, context, cb);
                })
                .seq(function (cb) {
                    model.validateAndSave(options, cb);
                })
                .seq(function (cb) {
                    self._afterModelUpdate(model, context, cb);
                })
                .exec(function (err, results) {
                    if (!err) {
                        // TODO: do correct invalidation
                        results.collection.invalidatePageCache();

                        self._fetchAllHrefsForModel(model, context);

                        // TODO: generate the location header
                        var body = JSON.stringify(processor.compose(model, null));

                        var response = context.response;
                        response.writeHead(200, "", {
                            'Content-Type': 'application/json'
                            // TODO : add updated date in head ???
//                            'Location': context.request.urlInfo.uri
                        });

                        response.write(body);
                        response.end();

                        callback(null);
                    } else {
                        if (!(err instanceof HttpError)) {
                            var statusCode = 400;
                            if (err === DataSource.ERROR.NOT_FOUND) {
                                statusCode = 404;
                            }
                            err = new HttpError(err, statusCode);
                        }
                        callback(err);
                    }
                });

        }
923311
private void updateSourceValues() {
        JDBCConnectionManager man = JDBCConnectionManager.getJDBCConnectionManager();
        try {
            man.closeConnection();
        } catch (SQLException e) {
            // do nothing
        }

        String username = txtDatabaseUsername.getText();
        OBDADataSource currentDataSource = obdaModel.getDatasource();
        currentDataSource.setParameter(RDBMSourceParameterConstants.DATABASE_USERNAME, username);
        String password = new String(txtDatabasePassword.getPassword());
        currentDataSource.setParameter(RDBMSourceParameterConstants.DATABASE_PASSWORD, password);
        String driver = txtJdbcDriver.getSelectedIndex() == 0 ? "" : (String) txtJdbcDriver.getSelectedItem();
        currentDataSource.setParameter(RDBMSourceParameterConstants.DATABASE_DRIVER, driver);
        String url = txtJdbcUrl.getText();
        currentDataSource.setParameter(RDBMSourceParameterConstants.DATABASE_URL, url);

        if (url.endsWith(" ")) {
            lblConnectionStatus.setForeground(Color.RED);
            lblConnectionStatus.setText("Warning the URL ends with a white space, this can give rise to connection problems");
        } else if (driver.endsWith(" ")) {
            lblConnectionStatus.setForeground(Color.RED);
            lblConnectionStatus.setText("Warning the Driver class ends with a white space, this can give rise to connection problems");
        } else if (password.endsWith(" ")) {
            lblConnectionStatus.setForeground(Color.RED);
            lblConnectionStatus.setText("Warning the password ends with a white space, this can give rise to connection problems");
        } else if (username.endsWith(" ")) {
            lblConnectionStatus.setForeground(Color.RED);
            lblConnectionStatus.setText("Warning the password ends with a white space, this can give rise to connection problems");
        } else {
            lblConnectionStatus.setText("");
        }

        obdaModel.fireSourceParametersUpdated();
    }