public void retry(String query) {
		boolean passed = false;
		Connection connection = open();
		Statement statement = null;
		count = 0;

		while (!passed || count < timeout) {
			try {
				statement = connection.createStatement();
				statement.executeQuery(query);
				statement.close();
				connection.close();
				passed = true;
			} catch (SQLException ex) {
				if (ex.getMessage().toLowerCase().contains("locking") || ex.getMessage().toLowerCase().contains("locked") ) {
					passed = false;
					count++;
					this.writeError("Locked",false);
				} else {
					this.writeError("Error at SQL Query: " + ex.getMessage(), false);
				}
			}
		}
		if(count >= timeout)
		{
			this.writeError("Failed to write to SQLite database. Timed out.",true);
		}
	}