(cc: -dev +user, bcc: +dev)

Hi Krishna,

Might you be able to share the stacktrace that accompanied that Exception?

Shiva Krishna wrote:
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.

Reply via email to