Forum: Building VoltDB Clients

Post: BoneCP & VoltDB

BoneCP & VoltDB
hzj5016
Feb 10, 2015
Hi all,

In my J2EE project, I use BoneCP as datasource to connect VoltDB. But it's go wrong when the project running.

The config of BoneCP like this :
<bean id="dsVoltdb" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="org.voltdb.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:voltdb://192.168.1.79:21216"/>
<property name="password" value="ticket"/>
<property name="username" value="ticket"/>
<property name="maxConnectionsPerPartition" value="15"/>
<property name="minConnectionsPerPartition" value="5"/>
<property name="partitionCount" value="3"/>
<property name="connectionTimeoutInMs" value="45000" />
<property name="idleConnectionTestPeriodInSeconds" value="3600" />
<property name="maxConnectionAgeInSeconds" value="14400" />
<property name="acquireIncrement" value="2"/>
<property name="poolName" value="dsVoltdb" />
<property name="releaseHelperThreads" value="3"/>
</bean>


And the message of exception is :
Caused by: java.sql.SQLException: Connection failure: 'No connections.'
at org.voltdb.jdbc.SQLError.get(SQLError.java:60)
at org.voltdb.jdbc.JDBC4Statement$VoltSQL.execute(JDBC4Statement.java:132)
at org.voltdb.jdbc.JDBC4Statement.executeQuery(JDBC4Statement.java:494)
at org.voltdb.jdbc.JDBC4PreparedStatement.executeQuery(JDBC4PreparedStatement.java:120)
at com.jolbox.bonecp.PreparedStatementHandle.executeQuery(PreparedStatementHandle.java:172)
... 34 more
Caused by: org.voltdb.client.NoConnectionsException: No connections.
at org.voltdb.client.Distributer.queue(Distributer.java:687)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:225)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:190)
at org.voltdb.jdbc.JDBC4ClientConnection.execute(JDBC4ClientConnection.java:200)
at org.voltdb.jdbc.JDBC4Statement$VoltSQL.execute(JDBC4Statement.java:102)
... 38 more


I don't konw why. Before the exception happen, project is normal operation.
Thanks for any help!
Server listens to client connections on port 21212
vtkstef
Feb 10, 2015
Try


<property name="jdbcUrl" value="jdbc:voltdb://192.168.1.79:21212"/>


Ciao
Stefano
hzj5016
Feb 11, 2015
Thanks, vtkstef.
But port is correct. My voltDB server is listening on port 21216.
And the exception doesn't always appear at first, my application will be running normally in a period of time.
hzj5016
Feb 11, 2015
May be BoneCP isn't suit VoltDB? Use the client of VoltDB? like use Memcached client? (Of course, Memcached is different from VoltDB)

In a word, I can use VoltDB client to connect VoltDB server without datasource(eg. BoneCP DBCP C3P0)?
vtkstef
Feb 11, 2015
The exception indicates that the connection was closed. Perhaps you may not want to specify the connection timeout property in BoneCP? Are you connecting to a cluster and the node you connected to went down? Did you restart VoltDB after you had BoneCP configured and running?

VoltDB connections are highly concurrent so try it with the springs' single source connection datasource (or your preferred way to set up a single connection data source)

Ciao
Stefano
hzj5016
Feb 11, 2015
The exception indicates that the connection was closed. Perhaps you may not want to specify the connection timeout property in BoneCP? Are you connecting to a cluster and the node you connected to went down? Did you restart VoltDB after you had BoneCP configured and running?

VoltDB connections are highly concurrent so try it with the springs' single source connection datasource (or your preferred way to set up a single connection data source)

Ciao
Stefano


1. I'm sure VoltDB server(single node and no cluster) is running normally.
2. Very strange is some queries will be worry but other not when the exception appear. In other words, query A will be failure because "no connections", and query B always success. May be a partition of BoneCP was down or closed? But why only query A fail?
3. The exception is not easy to review, and affects a part of queries. I think it has nothing to do with high stress of server, because I has tested application with JMeter.
anish
Feb 12, 2015
1. I'm sure VoltDB server(single node and no cluster) is running normally.
2. Very strange is some queries will be worry but other not when the exception appear. In other words, query A will be failure because "no connections", and query B always success. May be a partition of BoneCP was down or closed? But why only query A fail?
3. The exception is not easy to review, and affects a part of queries. I think it has nothing to do with high stress of server, because I has tested application with JMeter.


Can you specify datasource without BoneCP connection pool and see if it happens. We inside driver has a connection pool already so you dont need additional connection pool.

Anish
hzj5016
Feb 13, 2015
Thanks, Anish

Do you have document for help me? The develop document "8.3. JDBC Interface" shows a way that get connection by javax.sql.DriverManager, but must be load driver class and use DriverManager when I want to get connection each time?
anish
Feb 13, 2015
Thanks, Anish

Do you have document for help me? The develop document "8.3. JDBC Interface" shows a way that get connection by javax.sql.DriverManager, but must be load driver class and use DriverManager when I want to get connection each time?


Which app server you are using? I can give you a xml to use.
Anish
hzj5016
Feb 15, 2015
My server is a web application based on J2EE, and used spring 4.1.1.RELEASE

Looking forward to your help, Thanks
anish
Feb 17, 2015
My server is a web application based on J2EE, and used spring 4.1.1.RELEASE

Looking forward to your help, Thanks


Can you try using spring bean fill in properties from propertyConfigurer

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
hzj5016
Feb 27, 2015
Can you try using spring bean fill in properties from propertyConfigurer

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>


Thanks, anish
I will use the configuration and keeping to observe my application when it's running.
If my exception is reappeared, I will ask for help in the forum again.