Re: [Firebird-net-provider] Best practice for Rollback with EF and Firebird
> Your comment "...is only in database, not in context" indicates that > something needs to be done here: But what? You need to fix the problem in entity (or detach it, if you just want to throw it away). -- Mgr. Jiří Činčura Independent IT Specialist -- ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Best practice for Rollback with EF and Firebird
Hello Jiri, thanks for the fast response. I still have troubles arround clearing the context after an error happend on the database. I loop through N entities and modify them. The 3rd creates an error on the database which is reported back in an exception. Now the 4th and ongoing context.SaveChanges() will fail with the same error - but without having the problem at all. In my understanding the error stucks inside the context and I need to clean it up. Your comment "...is only in database, not in context" indicates that something needs to be done here: But what? Thanks Niko -Ursprüngliche Nachricht- Von: Jiří Činčura [mailto:j...@cincura.net] Gesendet: Dienstag, 13. September 2016 18:22 An: firebird-net-provider@lists.sourceforge.net Betreff: Re: [Firebird-net-provider] Best practice for Rollback with EF and Firebird > Is it really neccesssary to get transaction before > context:SaveChanges() in order to rollback? Yes, if you want to rollback manually. OTOH if there's an error while processing the data, the rollback is automatic. Also take into account that the transaction is only in database, not in context. -- Mgr. Jiří Činčura Independent IT Specialist -- ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Best practice for Rollback with EF and Firebird
> Is it really neccesssary to get transaction before context:SaveChanges() > in > order to rollback? Yes, if you want to rollback manually. OTOH if there's an error while processing the data, the rollback is automatic. Also take into account that the transaction is only in database, not in context. -- Mgr. Jiří Činčura Independent IT Specialist -- ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
[Firebird-net-provider] Best practice for Rollback with EF and Firebird
Hello, what is the best practice to rollback a failed statement with EF? 1. Working with an entity in a context 2. Putting a raw SQL statement to the database via the context Is it really neccesssary to get transaction before context:SaveChanges() in order to rollback? Thanks Niko -- ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider