Runtime problems with multiple connections

Stephen Gross <[email protected]> Tue, 14 Sep 2004 10:45:48 -0400 (EDT)
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Message-ID <[email protected]>
Ok, I'm trying to set up some code to do a basic checkout. Here's what
I've got so far:

========= CODE FOLLOWS ===========


        PServerConnection connection = new PServerConnection();

        try
        {
            System.out.println("Trying to establish connection...");

            // Please note that the "..."'s in my code are correctly
            // replaced with the correct text.

            connection.setUserName("...");
            connection.setEncodedPassword(CVSScramble.scramblePassword(new String("..."), 'A'));
            connection.setHostName("...");
            connection.setRepository("...");
            connection.open();
        }
        catch (Exception e)
        {
            System.out.println("Exception!");
            System.exit(0);
        }

        Client client = new Client(connection, new StandardAdminHandler());
        client.setLocalPath("D:\\Development\\Java\\testcvs");

        try
        {
            System.out.println("Ensuring connection...");
            client.ensureConnection();
        }
        catch (AuthenticationException e)
        {
            System.out.println("AuthenticationException");
            System.exit(0);
        }

        System.out.println("Is first command? " + client.isFirstCommand());

        CheckoutCommand command = new CheckoutCommand();
        command.setModule("uml");
        command.setCheckoutDirectory("D:\\Development\\Java\\testcvs");

        GlobalOptions global_options = new GlobalOptions();

global_options.setCVSRoot(":pserver:[email protected]:/home/sage_dev/cvs");

        try
        {
            System.out.println("Trying to execute checkout command...");
            client.executeCommand(command, global_options);
        }
        catch (CommandAbortedException e) { System.out.println("CommandAbortedException"); }
        catch (AuthenticationException e) { System.out.println("AuthenticationException"); }
        catch (CommandException        e) { System.out.println("CommandException");        }
        catch (Exception               e) { System.out.println("Exception!");              }

        try { connection.close(); } catch (Exception e) { }

========== CODE ENDS ===============

My problem is that when I run the program, everytime I get the following
warning/error message:

"Please be warned that attempting to reuse one open connection for more
commands is not supported by cvs servers very well.
You are advised to open a new Connection each time.
If you still want to proceed, please do:
System.setProperty("javacvs.multiple_commands_warning", "false")
That will disable this message."

What's the deal? Am I setting up my connection incorrectly?

--Steve

Stephen Gross
Case Western School of Medicine
Department of Epidemiology and Biostatistics
(216)368-5632