This is the server side. There is one big problem for the server side case that has different behavior as the client side case. This particular method, UngroupedAggregateRegionObserver.doPostScannerOpen, would catch ConstraintViolationException and swallow the exception silently. Therefore, instead of failing on the upsert case, the upsert would execute and fail silently. The client won't realize until it tries to read the value back, which would get a null. This behavior is documented on one of the test case.

I think to make the behavior consistent, we should not catch the ConstraintViolationException, and let the whole transaction fail.

I tested on Oracle and Derby, they would both abort the whole transaction if one of the value does not fit. Which is what our client side execution case is now.