phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shiva Krishna <shiva.krishn...@gmail.com>
Subject Sample phoenix upserts using threads
Date Tue, 01 Nov 2016 07:16:47 GMT
Hi All,
Can any one give me a small example of Phoenix upserts using Threads in Java.
I wrote a sample it is working fine in local environment but when running it cluster it is
failing with below error.
java.lang.AssertionError: we should never remove a different context

try(Connection conn = getConnection();
     PreparedStatement statement = conn.prepareStatement("upsert into \”test\" values(?,?,?)");){
	statement.setString(1,”test1”);
	statement.setString(2,”test2”);
	statement.setString(3,”test3”);
	statement.execute();
	conn.commit();
}catch(SqlException ex)
{
	ex.printStackTrace();
}
Tried using both Threads and ForkJoins but getting the same exception some times we are not
able to predict or generalise when this exception is occurring or how to resolve it.
 
Thanks,
Krishna.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message