Forum: Building VoltDB Applications

Post: Newcomer problem: Insert error org.voltdb.client.ProcCallException

Newcomer problem: Insert error org.voltdb.client.ProcCallException
jricardooliveira
Jan 28, 2011
Hi,
I have this table:

CREATE TABLE VOTERS ( CCID VARCHAR(10) NOT NULL, VOTERID VARCHAR(19), NAME VARCHAR(100), CITY VARCHAR(50), PRIMARY KEY (CCID) ); Insert.java

import org.voltdb.*; @ProcInfo( partitionInfo = "VOTERS.CCID: 0", singlePartition = true ) public class Insert extends VoltProcedure { public final SQLStmt sql = new SQLStmt( "INSERT INTO VOTERS VALUES (?, ?, ?, ?);" ); public VoltTable[] run( String ccid, String voterid, String name, String city) throws VoltAbortException { voltQueueSQL( sql, ccid, voterid, name, city ); voltExecuteSQL(); return null; } } This Client.java

import org.voltdb.*; import org.voltdb.client.*; public class Bulk { public static void main(String[] args) throws Exception { org.voltdb.client.Client myApp; myApp = ClientFactory.createClient(); myApp.createConnection("localhost"); int number = 1; String ccid = "C"; while (number <= 100) { ccid = "C" + number; System.out.printf(ccid); myApp.callProcedure("Insert", ccid, "123", "John", "Lisbon"); number++; } } } Why I get this error:

[root@ip-10-48-242-176 test]# javac Bulk.java [root@ip-10-48-242-176 test]# java Bulk No logging configuration supplied via -Dlog4j.configuration. Supplying default config that logs INFO or higher to STDOUT C300C301Exception in thread "main" org.voltdb.client.ProcCallException: =============================================================================== VOLTDB ERROR: UNEXPECTED FAILURE: Possible Null Pointer Exception (EEException) at Insert.run(Insert.java:20) =============================================================================== at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:213) at Bulk.main(Bulk.java:17) Caused by: org.voltdb.exceptions.EEException: at org.voltdb.exceptions.SerializableException$SerializableExceptions$2.deserializeException(SerializableException.java:59) at org.voltdb.exceptions.SerializableException.deserializeFromBuffer(SerializableException.java:184) at org.voltdb.ClientResponseImpl.readExternal(ClientResponseImpl.java:173) at org.voltdb.messaging.FastDeserializer.readObject(FastDeserializer.java:114) at org.voltdb.client.Distributer$NodeConnection.handleMessage(Distributer.java:217) at org.voltdb.network.VoltPort.call(VoltPort.java:142) at org.voltdb.network.VoltNetwork$3.run(VoltNetwork.java:520) at org.voltdb.network.VoltNetwork.invokeCallbacks(VoltNetwork.java:553) at org.voltdb.network.VoltNetwork.run(VoltNetwork.java:394) at java.lang.Thread.run(Thread.java:662) Help appreciated,
Best Regards
Joao
re: newcomer problem
tcallaghan
Jan 28, 2011
Joao,
I took your schema, client, and stored procedure and ran it without issue. I just emailed my project to you (including an ant build script).
I'm not sure if there is anything external to what you posted that could be causing this issue.
-Tim
Hi, Really strange... my code
jricardooliveira
Jan 28, 2011
Joao,
I took your schema, client, and stored procedure and ran it without issue. I just emailed my project to you (including an ant build script).
I'm not sure if there is anything external to what you posted that could be causing this issue.
-Tim


Hi,
Really strange... my code didn't work. And yours work on my server too.
Btw, 9 minutes isn't it too much to insert 90000 records? Take a look:

import org.voltdb.*; import org.voltdb.client.*; public class Bulk { public static void main(String[] args) throws Exception { org.voltdb.client.Client myApp; myApp = ClientFactory.createClient(); myApp.createConnection("localhost"); int number = 10001; String ccid = "C"; while (number <= 100000) { ccid = "C" + number; myApp.callProcedure("Insert", ccid, "123", "John", "Lisbon"); number++; } } } [root@ip-10-227-123-160 com]# time java Bulk
No logging configuration supplied via -Dlog4j.configuration. Supplying default config that logs INFO or higher to STDOUT
real 9m17.083s
user 0m1.031s
sys 0m0.095s
9 minutes and 17 seconds on a Large EC2 Instance. is this normal?
BR
Joao
re: performance
tcallaghan
Jan 28, 2011
Hi,
Really strange... my code didn't work. And yours work on my server too.
Btw, 9 minutes isn't it too much to insert 90000 records? Take a look:

import org.voltdb.*; import org.voltdb.client.*; public class Bulk { public static void main(String[] args) throws Exception { org.voltdb.client.Client myApp; myApp = ClientFactory.createClient(); myApp.createConnection("localhost"); int number = 10001; String ccid = "C"; while (number <= 100000) { ccid = "C" + number; myApp.callProcedure("Insert", ccid, "123", "John", "Lisbon"); number++; } } } [root@ip-10-227-123-160 com]# time java Bulk
No logging configuration supplied via -Dlog4j.configuration. Supplying default config that logs INFO or higher to STDOUT
real 9m17.083s
user 0m1.031s
sys 0m0.095s
9 minutes and 17 seconds on a Large EC2 Instance. is this normal?
BR
Joao


Joao,
You are seeing this performance not because the database performance, it is the ability of your client to create work. Your client application is generating stored procedure invocations synchronously, you will go much faster by changing the client to be asynchronous.
Change this line of code in your client application from:
myApp.callProcedure("Insert", ccid, "123", "John", "Lisbon");
to:
myApp.callProcedure(new NullCallback(), "Insert", ccid, "123", "John", "Lisbon");
When you call stored procedures in VoltDB you can do it asynchronously, the change is that you supply your callback to the callProcedure method. I've put a NullCallback() just to get you moving, check the documentation for more information on how to specify a callback that takes the response of your procedure.DesignAppLogic
Please rerun your benchmark and let us know the results when running asynchronously.
-Tim
Huge difference
jricardooliveira
Jan 28, 2011
Huge difference :)
[root@ip-10-227-110-128 com]# time java Bulk
No logging configuration supplied via -Dlog4j.configuration. Supplying default config that logs INFO or higher to STDOUT
real 0m7.452s
user 0m2.566s
sys 0m0.164s
:) Thanks for the help :)
Joao