Announcement

Collapse
No announcement yet.

VoltDB jdbc throws ‘Too many pending stat requests'

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VoltDB jdbc throws ‘Too many pending stat requests'

    'Too many pending stat requests'
    org.voltdb.jdbc.SQLError.get(SQLError.java:60)
    org.voltdb.jdbc.JDBC4Statement$VoltSQL.execute(JDB C4Statement.java:143)
    org.voltdb.jdbc.JDBC4Statement.executeQuery(JDBC4S tatement.java:458)
    org.voltdb.jdbc.JDBC4PreparedStatement.executeQuer y(JDBC4PreparedStatement.java:123)
    org.voltdb.jdbc.JDBC4DatabaseMetaData.loadSystemIn formation(JDBC4DatabaseMetaData.java:62)
    org.voltdb.jdbc.JDBC4DatabaseMetaData.<init>(JDBC4 DatabaseMetaData.java:53)
    org.voltdb.jdbc.JDBC4Connection.getMetaData(JDBC4C onnection.java:278)


    As show as above, I have use a 80 threads to getMetaData, and then i throws the error. How can I handle it. the code is like :

    public class test extends thread {
    public void run() {
    ....
    connection.getMetaData();
    ....
    }
    }

    for(int i = 0; i < 80; i++)
    new test().start

  • #2
    Hi,

    The connection.getMetaData() call invokes a system procedure @SystemInformation. There are special threads on each server that handle system procedure calls, and since these are informational rather than transactions, there is a back-pressure mechanism that returns "Too many pending stat requests" to these calls.

    Is the connection.getMetaData() call throwing a SQLException?

    If so, you can catch this exception and try calling getMetaData() again until it is successful.

    You could avoid this by adding a small delay to when these threads are started or the getMetaData is called, but this shouldn't even be necessary because you can use a single Connection object.

    Typically we recommend using a single JDBC connection, which can be shared across multiple threads, as is shown in our JDBC benchmark examples:
    ./examples/voltkv/client/voltkv/JDBCBenchmark.java
    ./examples/voltkv/src/voltkv/JDBCBenchmark.java
    ./examples/voter/client/voter/JDBCBenchmark.java

    Many other databases are limited to one synchronous call per connection, so you would use connection pooling and separate connections for each application thread. VoltDB's JDBC driver supports concurrent calls with the same connection, so you can safely share it with multiple application threads.

    Comment


    • #3
      Thank you for your response, I used to set up connection for each thread, and I will try as your recommend. just one connection and share

      Comment

      Working...
      X