IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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

Query times using Tamino API for Java

  • 1.  Query times using Tamino API for Java

    Posted Thu February 19, 2004 09:27 AM

    I have a small database (“mydb”) with about 3000 records. I was experimenting with the Java API by making a simple query interface.

    My querying code is as follows:

                long start = System.currentTimeMillis();
    
    // return all docs
    TXQuery query = TXQuery.newInstance("for $a in input()/mydb return $a");
    
    TResponse response = xmlObjectAccessor.xquery(query, 10);
    System.out.println((((double) (System.currentTimeMillis() - start)) / 1000) + "s.");



    Now when I run this query, it takes about 100 seconds to execute.

    When I run the same query using the Tamino Interactive Interface with a result size of 16, the results are displayed within a couple of seconds.

    I would like to know two things:
    1. Why is there such a huge difference in the time taken?

    2. In the Java code, does the query execution time depend on the result size parameter supplied (10 in my code)? For eg, what if I used the method xquery(TXQuery query) instead of xquery(TXQuery query, int quantity)? Would it take longer for it to execute the query? (the result set would contain 3000 records)

    The point is that when I make queries that return a lot of records, I want to be able to get the first set of results quickly. I don’t mind if it takes some time to get each subsequent result set.

    What is the best way to do this using the Java API?


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


  • 2.  RE: Query times using Tamino API for Java

    Posted Mon April 05, 2004 06:52 PM

    Have a look at the setLockMode() method of the TConnection class. I’m a total newbie, but I read somewhere that if you set it to unprotected

    _connection.setLockMode(TLockMode.UNPROTECTED)

    then this stops Tamino from locking every single record for the duration of the query. The locking takes a LONG time.


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