Reputation: 4185
Is there something in EF 4.1 that allows for a reconnect to a database should the connection get broken. If so can EF remember what wasn't yet committed and then commit it once reconnected?
If not is there a way that I can program for this occurrence so as to not lose data?
Upvotes: 0
Views: 671
Reputation: 364259
When connection is broken during saving your changes you simply get exception. Whole saving is done in transaction which is not committed due to the exception and EF doesn't mark its current changes set as completed. You can simply try to save changes again - EF will try to open a new connection and execute the same transaction.
Upvotes: 1