0

We have implemented an WordAddin and use EF6 to connect to the oracle database. With the addin the user can load a document from the database. After editing the document the user closes the document. We use the DocumentBeforeClose-Event to update the document in the database. Only one user can edit and save the document in the database. The problem is, that sometimes in oracle row lock contentions exists. To my knowledge row lock means, that one transaction is update the row and another is waiting. Is it possible, that if the db connection during the SaveChanges is lost, the transaction is not committed? Or if word is closed unexpectly during the SaveChange?

After closing the document in word, word is closed per code, can that be the problem?

spoerl
  • 1

1 Answers1

1

It's not likely that the transaction is committed when the connection is lost while saving.

EF starts a transaction when SaveChanges is executed and commits it at the very end of all database interaction. Only if right after saving data another database interaction is initiated will a lost connection be noticed while saving was successful.

What you need is a retry policy to make sure that precious modifications won't be lost.

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
  • I can't judge the effect of closing Word while saving changes. I imagine that the actual `SaveChanges` won't start before Word has successfully saved its document, so if it crashes, `SaveChanges` probably won't run. – Gert Arnold Jun 07 '19 at 19:18