heqiao commented on issue #7703: URL: https://github.com/apache/shardingsphere/issues/7703#issuecomment-714273218
> > Actually.... after a second read through of the above conversation, Trista's suggestion makes more sense. The set clause should not have sharding key. So the sharding key should not be updatable. And this solves the problem. > > `@Column(name = "xxx", updatable = false)` > > I think I need a Rubber Duck. > > But this will execute the update query in all the shards :) Which is not optimal. > So even if the sharding column appears in the SET clause, the value may not have really changed... just that the field appears in SET clause. > > Maybe there can be some annotation from sharding-sphere or some flag by which we can suppress that exception from SS because it's much more complex to explicitly include the sharding column in the where clause, especially when there's @Version involved. ah that's right. Thought I found a solution :( ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
