I have an entity in my service that I'd like to update asynchronously @Async.
For simplicity sake let it be the following entity:
public class Child {
 @Id
 private String name;
 private String bestFriend;
 private String worstFriend;
}
I have 2 places in my code where I need to asynchronously update a child's bestFriend and worstFriend properties, moreover, I'd like to make all calls to a repository are asynchronous. Notice, that each field is updated exactly once so the question is not in a race condition or versioning.
It means that on each update I have to check if a child with such name exists and if yes then set it's field to an updated value, if not then insert a new entity.
I thought that REPEATABLE_READ can assist me but Oracle 11g doesn't support this isolation level.
Could you give me your ideas or maybe a query that can execute "INSERT IF NOT EXISTS ELSE SET"?
 
    