webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

How can I create multiple connections to Tamino with a Threa

  • 1.  How can I create multiple connections to Tamino with a Threa

    Posted Fri November 29, 2002 01:16 PM

    Hello,
    I am trying to create a thread operation to increase performance in my application. I have created a connectFactory object(example code)that get a tamino connection and returns it to the requesting class. This work fine running as a interactive process, but when I spawn the whole processing as a thread I get “server not available” errors. Is what I am trying to do possible?

    Kind regards,

    Andy


    /** get a connection to the Tamino database
    */
    public synchronized TConnection getConnection(String databaseURI, String collection) throws Exception
    {

    // local transaction object
    TLocalTransaction localTransaction;

    // The database connection
    TConnection connection=null;

    try
    {

    // Obtain the connection factory
    TConnectionFactory connectionFactory = TConnectionFactory.getInstance();

    // Obtain the connection to the database
    connection = connectionFactory.newConnection( databaseURI );
    connection.useAutoCommitMode();

    }
    catch (Exception e)
    {
    Debug.out(“EXCEPTION: ConnectionFactory >> getConnection–” + e);
    }


    return connection;

    } // end of getConnection method

    }


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 2.  RE: How can I create multiple connections to Tamino with a Threa

    Posted Mon December 02, 2002 12:50 PM

    Hi Andrew,

    from looking at your code, we can not see any problem. It should work. The only thing I can think of right now is: When the exception occurs, can you print it out with the method toXMLString() and post the output here. Maybe our experts can spot a detail, which hints us to the reason for the problem.

    Cheers, Christian.


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods