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?

1
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.