17. December 2009 22:18
This is a short post that falls under the category. Future lookup for me. The past year I have worked a lot with Nhibernate. In my opinion it’s the closest you come to a perfect Object Relational Mapper. But besides getting the hang of how to handle the ISession (“basically” the unit of work) one thing i constantly forget is what precisely what Flush does. From the intellisense they pull a “Microsoft documentation” on me.
Well almost. Ps by Microsoft Documentation. F.ex: object.DoSomethingStrange() (“Will do something strange”). Well I’m pretty sure most people now what Flush does. But here goes based on the documentation:
Short Version: Flush will synchronize the changes you have made to the ISession object you are working on. Meaning that some calls will be made to the database (select insert etc.). So it’s roughly: ExecuteTheRelevantSqlBasedOnPreviousOperations() .
You will most likely not need to call Flush() as it is handled automatically for you during your operations. Most query operations will automatically perform the flush. if you wrap a using around a ITransaction. Flush will automatically be called.
Thanks for your time.
remember: Stay away from the dark side of the force