- 
    Type:Task 
- 
    Resolution: Done
- 
    Priority:Critical - P2 
- 
    None
- 
        🔵 Done
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
Currently, StatelessSession.upsert does not result in FeatureNotSupportedException/SQLFeatureNotSupportedException, instead it behaves incorrectly:
- It seem to result in executing two operations one after the other: at first update, then insert.
- update has field values associated with wrong field names, which also means that the _id filter for the update operation has wrong value.
- When upserting a document with a non-existing _id, it is successfully inserted. However, the aforementioned update behavior may accidentally corrupt an unrelated document it if happens to have _id equal to whatever value gets used in the update filter.
- When upserting a document with a pre-existing _id, upsertion fails because insert fails. Though the reported error is misleading for the reasons reported in HIBERNATE-95.
- is related to
- 
                    HIBERNATE-94 implement upsert MQL translation from HQL's insertion conflict clause -         
- Backlog
 
-         
- links to