@Override
			public synchronized void run() {
				try {
					logger.debug("Updating server heartbeat timestamp...");	
					Connection dbConnection = DbHelper.getMainDb().getConnection();
					if (dbConnection == null) {
						logger.error("Error connecting to database when trying to update heartbeat timestamp. Timestamp won't be updated this time.");
					}
					else {
						Timestamp currentTimestamp = new Timestamp(System.currentTimeMillis());
						PreparedStatement s;
						try {
							s = dbConnection.prepareStatement("UPDATE processing_servers SET heartbeat=? WHERE id=?");
							s.setTimestamp(1, currentTimestamp);
							s.setInt(2, serverId);
							if (s.executeUpdate() != 1) {
								logger.warn("No records were effected when trying to update the timestamp for the server.");
							}
							s.close();
						} catch (SQLException e) {
							logger.error("SQLException when trying to update server heartbeat timestamp.");
							e.printStackTrace();
						}
					}
					
					if (dbConnection != null) {
						try {
							dbConnection.close();
						} catch (SQLException e) {
							e.printStackTrace();
						}
					}
					logger.debug("Updated server heartbeat timestamp.");
				}
				catch (Exception e) {
					logger.error("Exception occurred whilst trying to update server heartbeat timestamp.");
					e.printStackTrace();
				}
			}