Data saved but no saga saved

sagas

#1

Hi,

We’re using NServiceBus 4.6.5, with Oracle database, and for a specific request, intermittently the data is saved into our database, but the corresponding sagaData is not saved to the database.

I looked at the logs and can’t find an explanation.

If you need me to post here more information just let me know, as I have no idea where to start.

Thanks,
Miguel


(Szymon Pobiega) #2

Hi

It would be useful to see how you configure the Bus and how the handler manages the transactions and/or connections to the database.

Szymon


(Dennis van der Stelt) #3

This question is a double post of this one on StackOverflow.


#4

I added the code into this Stack Overflow Question: https://stackoverflow.com/questions/48460276/nservicebus-data-saved-but-no-saga-saved


#5

We have a Master and 2 Worker Servers. Might it be the case that the SagaData in 1 server is out of sync with the SagaData in another server? We persist the SagaData to Oracle.

How does NServiceBus guarantee that the SagaData in our situation is in sync in the 3 servers (Master and Workers)?


#6

Edit: I added another Stack Overflow Question: https://stackoverflow.com/questions/50490742/nservicebus-how-to-make-sure-sagadata-is-in-sync-between-the-worker-servers


(Szymon Pobiega) #7

Hi

The links you pasted point to the same question. Was that intentional?

Regarding the missing changes in the saga data. Do you know if the changes are missing permanently or they are not visible just yet when the second message arrives? i.e. the second message gets processed concurrently with the first message.

The saga data objects are not stored in memory. The changes are synced back to the database before committing the message receive transaction. NHibernate persistence by default uses optimistic concurrency approach by appending a WHERE clause to each UPDATE using values known at the time of loading the saga. This prevents two messages from updating the saga information concurrently without knowing about each other thus overwriting each other’s data.