Emmanuel Bernard, my first idea would be to add this to GridDialect:
enum DuplicateInsertPreventionStrategy {
NONE, LOOK_UP, NATIVE, ROLLBACK_UPON_DUPLICATE }
DuplicateInsertPreventionStrategy getDuplicateInsertPreventionStrategy();
It would return LOOK_UP by default as implemented in BaseGridDialect. In order to support ROLLBACK_UPON_DUPLICATE, we'd also have to change the return type of insertOrUpdateTuple() to signal whether an insert or update was performed.
Surely the details would have to be refined, but that it generally sound sensible?
|