user2448792
user2448792

Reputation: 1

Phoenix - JDBCTemplate update

I have problem with upserting values in apache phoenix via Spring JdbcTemplate. Query works fine, so i connect correctly with Phoenix. Also when i make update via straight JDBC it works.

Only when i use update method it does not produce any effect in database. There is no errors or warns. My code:

String sql = "upsert into fanpages(ID,NAME,CATEGORY) VALUES (7, 'new', 'new')";
jdbcTemplateObject.update(sql);

Console:

DEBUG: org.springframework.jdbc.core.JdbcTemplate - Executing SQL update [upsert into fanpages(ID,NAME,CATEGORY) VALUES (7, 'new', 'new')]
DEBUG: org.springframework.jdbc.core.JdbcTemplate - SQL update affected 1 rows

Did i miss something? Why it does not work?

Upvotes: 0

Views: 964

Answers (1)

Tao Xiao
Tao Xiao

Reputation: 31

Have you tried invoking commit? I used jaydebeapi, which is a python module, to upsert into a phoenix table. Only when I called commit can the value be truly be upserted into the table.

Upvotes: 1

Related Questions