public void updateDataBase()
    {

	String masterHostName = null;
	int masterPortNumber = 0;
	String masterKey = null;
	for (NodeState server : pool)
	{
	    try
	    {
		Registry registry = LocateRegistry.getRegistry(server.getHostname(), server.getPortNumber());
		RemoteBullyPassiveNode stub = (RemoteBullyPassiveNode) registry.lookup(server.getKey());

		NodeProperties masterProp = stub.getMasterServer();
		masterKey = masterProp.getKey();
		masterHostName = masterProp.getHostname();
		masterPortNumber = masterProp.getPortNumber();
		break;
	    } catch (RemoteException | NotBoundException e)
	    {
		System.err.println(e);
	    }
	}

	if (masterHostName == null || masterPortNumber == 0 || masterKey == null)
	{
	    masterHostName = self.getHostname();
	    masterPortNumber = self.getPortNumber();
	    masterKey = self.getKey();
	}
	try
	{
	    Date latestLogDate = this.getLatestLogDate();
	    Registry registry = LocateRegistry.getRegistry(masterHostName, masterPortNumber);
	    RemoteBullyPassiveNode stub = (RemoteBullyPassiveNode) registry.lookup(masterKey);
	    List<EventLog> logsList = stub.getLogsToUpdate(latestLogDate);

	    for (EventLog eventLog : logsList)
	    {
		executeLog(eventLog);
	    }

	} catch (NullPointerException npe)
	{
	    System.err.println("Nenhum servidor ligado");
	    // não precisa de fazer nenhum update
	} catch (RemoteException | NotBoundException e)
	{
	    System.err.println(e);
	}

	// block master database from accepting changes
	// get new logs
	//Date latestLogDate = this.getLatestLogDate();
	//master.getObject();
	// update db from new logs
	// unblock master database
    }