0

I have a java program, I want to insert data into oracle db and solr at the same time. How can I make sure that data in the db and solr are consistent?

asked Jun 5, 2018 at 2:51
1

2 Answers 2

1

Knowing nothing about Solr, I'll assume it's non-transactional.

In that case, start a transaction in Oracle database and make changes. Then make the matching changes in Solr. If the Solr changes succeed, commit the Oracle transaction; if not, roll it back.

It's not perfect by any means but you're using the transactional strength of one element to make up for the deficiencies of the other.

answered Jun 6, 2018 at 10:19
0

You would have to update one in a transaction and, while the transaction is still active, update the other. If both succeed then commit the transaction. If either the first or second fail, roll back the transaction.

answered Jun 5, 2018 at 18:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.