solidstore wrote:
agreed, but I'm seeing an additional reset after calling SaveEntity before closing the connection in my code. I'm saving several entities within one api and after the 3 call to SaveEntity the underlying connection is closed, and therefore reset on the next call. Why might a connection be closed by SaveEntity?
Strange indeed. You save multiple entities in one routine? Do you start a transaction? Starting a transaction before the first save and committing it after the last save, keeps open the connection (of course) and makes sure the save is atomic.
Non-recursive saves as you perform, don't start their own transaction, so they then check if the connection is already open, if not, they open it. And at the end of the routine, it checks if the keepconnectionopen flag is set. If it's not set, connection is closed, otherwise it's kept open. (if a transaction is in progress it also is kept open).
You specify you don't want to refetch. SaveEntity() temporary manipulates keepConnectionOpen when refetch is set to true, so a refetch call doesn't close the connection. You specify false for that, so that's not an issue.
It's every 4th entity which produces the reset?