Download archive nhibernateidentity






















We tightened up database calls all over the application and in some spots saw a 10 fold increase in request time due to reduced network calls and optimized queries. As the author behind the NHibernate FAQ blog and frequent writer of articles and tutorials about NHibernate I often have to analyze in detail the behavior and the exact output generated by NHibernate in various usage scenarios.

From the very beginning NHProf has been an invaluable help to me in this regard. NHProf can be and was a real eye opener in regard of how to correctly and optimally use NHibernate in different use cases. Even in more involved situations NHProf has shown its value. Lately we discovered an unexpected behavior in one of our applications.

The application uses the 2nd level cache of NHibernate and the cache provider we used had a flaw. With NHProf we were able to quickly spot the flaw and once it was fixed verify the success.

NHProf is one of my favorite tools and is more than worth every penny spent on it. I recently purchased four copies of the Nhibernate Profiler for our engineering group in Oklahoma City. Our applications rely on the Castle::ActiveRecord and Nhibernate stack. Performance is very important to our customers but profiling and debugging database interactions has always been problematic.

The NHibernate profiler from Hibernating Rhinos has finally given us the in-depth detailed data that we need to quickly find the most performance sucking queries and eliminate them. As we introduce NHibernate into our integrated Intelligent Transport System ITS that manages traffic operations on motorways and surface streets, NHibernate Profiler provides us the best possible view into what NHibernate is doing under the covers, enabling us to improve the performance of our software and avoid common pitfalls.

NHibernate Profiler is the perfect companion in the development of applications using NHibernate. As a consultant I pride myself on delivering maximum value to my clients. NH Prof helps me to do so by allowing me to quickly and easily verify that I am using NHibernate in the best manner possible.

The peace of mind that NH Prof provides has made it become a critical tool for any project I work on which uses NHibernate. Our team is very new to NHibernate, so we were able to identify significant performance bottlenecks by using NH Prof.

Not only did it guide us by providing helpful feedback to help improve the performance of our application, but it also worked as a great tool for understanding and learning NHibernate.

As a team who is ramping up with Nhibernate, using NHProfiler has giving us the ability to not only spot performance bottleneck, but also our mapping errors. This tool has saved us countless hours and saved us from many headaches. The product is awesome and very well adapted to different configurations.

It can be configured only on debug mode which allows us to only activate statistics on a development environment without modifying any code. We used it to know how NHibernate processed our queries and we found out all the application bottlenecks. Thus, if you care about performance tuning and product quality, this product is a must-have inside your toolbox. Moreover, the special beta offer makes the product an interesting deal.

So what are you waiting for? Within barely 5 minutes of downloading, NHProfiler was up and running against our initial application. Within 10 minutes more we had identified a bad use of count against an ID and with the help NHProfiler provided we converted 3 very inefficient queries to a single roundtrip using NH Futures.

Another 20 minutes work and we were able to identify and eliminate entirely a few hundred individual selects to the database. No other tool pays for itself as fast as NHProfiler. My company bought 3 licenses and they have been worth every penny. Being able to clearly see what NHibernate is doing makes troubleshooting mapping issues a breeze.

Also, the NHibernate Profiler development team helped me troubleshoot a minor issue that ended up being a video driver issue on my end, so I have to give them kudos for awesome customer support.

I have struggled very much with this library, which is making me question why this is the recommended library for using OWIN with NHibernate. Anyway, to answer your question, the code you provided that you got from the github website adds NHibernate mappings for the library's classes.

NHibernate doesn't have a mapping for ApplicationUser , it only has a mapping for it's base class. NHibernate needs a mapping for the instantiated class.

This is problematic because you don't have access to the mapping code in the library's assembly, so you can't change it to use the ApplicationUser class instead. So the only way to get past this using the library as it is, is to remove the ApplicationUser class and use the library's IdentityUser class.

Or, you could copy the mapping code from github and try using the same mapping for ApplicationUser. Also, the library code and the code he gives for the AccountController does not ever open an NHibernate transaction, so even though the library calls Session.

Save and Session. Update the data won't ultimately be saved in the database. After you open the session you need to open a transaction and save it as a private field on the class:.

Then you need to call transaction. Commit after your action in the AccountController finishes executing, so you will need to override OnResultExecuted :. Furthermore, even after you solve those problems, there are other issues with the library. I ended up having to download the source from github so I could modify the library in order to use it. There are at least 3 other blatant errors in the library's code:.

For now, without looking more into it, in the UserStore update methods I changed the library's code to call SaveOrUpdate on the NHibernate session instead of Update which fixed the problem. After finding those errors, it makes me really nervous using it now. It seems there was absolutely no testing done with even simple scenarios. Take caution using this library.

I also struggled to use NHibernate. I found it was much easier just to make my own implementation using NHibernate, which I've turned into a minimal worked example here:. Then it's just a matter of writing a bit of glue to tell Owin to use that code. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. A database with k records is not so much.

To optimize access you should think about how you query and how to optimize for those queries. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?

Collectives on Stack Overflow. Learn more. Asked 10 years, 1 month ago. Active 10 years, 1 month ago. Viewed times. We have several Linq queries that operate over these accounts All our queries use Linq, most queries are dynamically built using predicate builder pattern we don't use Hql The problem is that, As the number of accounts increases the execution time for these queries increases.

But, Older accounts need to be preserved so cannot be deleted. Even though these accounts are not needed by the application it may be consumed later by the analytics application To solve this performance issue: we are considering archiving accounts that are older than 48hrs Creating an Archive database with the same schema as the main db Adding a windows service that is scheduled to run on a nightly basic that moves "old" accounts from the main db to the archive db The windows service will using nhiberate to read old accounts from the main db and save the old accounts again using nhibernate to the archive database, and then delete the old accounts from the main db.

Right now, we think this service will move one account at a time until all the old accounts are moved to the archive database. Ocassionally, when we do get a request to restore an account from the archive db, we will reverse the above step Questions: Is this archival approach any good?

If not, why?



0コメント

  • 1000 / 1000