Project A
Project B
Project C
Relation A
db.conversations.find({date: {$lte: "12 mars", $gte: "34 avril"}}).as(Conversation.class)
select *
from conversation
left outer join conversations_participants
on conversations_participants.conversation_id = conversation.id
left outer join participant
on participant.identity_id = conversations_participants.participant_id
left outer join message
on message.conversation_id = conversation.id
left outer join message_read_by
on participant.identity_id = message_read_by.participant_id
and message.id = message_read_by.message_id
left outer join temps_attachment
on temps_attachment.message_id = message.id
left outer join stored_file
on stored_file.message_id = message.id
where conversation.id in conversation_ids
order by
array_position(conversation_ids, conversation.id),
message.created_at,
stored_file.index,
temp_attachment.index
select conversation.id
from conversation
where conversation.date between "12 avril 2014" and "14 mars 2019"
order by conversation.date
select * from conversation
-- ...
where conversation.id in conversation_ids
order by array_position(conversation_ids, conversation.id)
@Test
void golden_master_simple_test() {
Conversation conversation = givenAConversation();
mongoRepository.save(conversation);
jooqRepository.save(conversation);
Conversation expected = mongoRepository.findById(conversation.getKey());
assertThat(jooqRepository.findById(conversation.getKey())).isEqualTo(expected);
}
findById
process
change data
save
throw event B
other stuff
findById
change data
save
Event A
Event B
findById
process
change data
save
throw event B
other stuff
findById
change data
save
Event A
Event B
throw transactional event B
Solution: TransactionalAwareEventService
findById
process
change data
save
other stuff
findById
change data
save
Event A
Event A
some stuff
findById
process
change data
save
other stuff
findById
change data
save
Event A
Event A
some stuff
select for update
select for update
Solution: Locking
select conversationId from conversation where conversationId = "1234" for update