0 views
Skip to first unread message

joseph gao

unread,
Jan 22, 2016, 1:18:42 AM1/22/16
to java-dri...@lists.datastax.com
Hi, All.
     Here is a strange problem, I'm using datasta java driver 3.0.0-beta1. In one of my client, I can't update a column which already has a value in cassandra. But in other of my client the same column could be updated. I'm curious about how does this happen?
     Could any one give me some suggestion, this is my code:
     PreparedStatement preparedStatement = getPreparedStatement(session, sql);
BoundStatement boundStatement = new BoundStatement(preparedStatement);
session.execute(boundStatement.bind(values.toArray()));

  sql : UPDATE xxx.xxx set columnA=?, columnB=? where id = ?;
values:someStringA,  someStringB, someUUID.

the columnA changed, but columnB not changed.  the difference is A is null and B is not before update. Thank you guys. 

--
------
Joseph Gao
PhoneNum:15210513582
QQ: 409343351

Olivier Michallat

unread,
Jan 22, 2016, 11:14:12 AM1/22/16
to java-dri...@lists.datastax.com
Hi,

How do you initially insert the row (before running the update)? This could be a timestamp ordering issue if you execute both queries in a short time. One way you could check is by selecting writeTime(columnA) and writeTime(columnB) from the row, normally it should be higher for columnA.

--

Olivier Michallat

Driver & tools engineer, DataStax


--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Olivier Michallat

unread,
Jan 22, 2016, 11:15:11 AM1/22/16
to java-dri...@lists.datastax.com
Nevermind, I just saw your other thread.

--

Olivier Michallat

Driver & tools engineer, DataStax


Reply all
Reply to author
Forward
0 new messages