Forum: Building VoltDB Clients

Post: VoltDB jdbc throws ‘Too many pending stat requests'

VoltDB jdbc throws ‘Too many pending stat requests'
Mar 8, 2017
'Too many pending stat requests'

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() {

for(int i = 0; i < 80; i++)
new test().start
Mar 8, 2017

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:

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.
Mar 9, 2017
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