Castle AR, getting data from DB, not the cache

2009-05-26 Thread vekaz turkovic
Hi all, I am using Castle AR in a WinForms application. I made a quick switch from Linq to Sql to AR near the end of a project, and didn't have the time to properly learn AR/NHibernate before I started using it. So, be gentle, this may be a really stupid question... Several users run the

Re: Castle AR, getting data from DB, not the cache

2009-05-26 Thread Jason Meckley
This may be harsh, but your first mistake was blindly applying a framework to a project which is almost complete. I made a quick switch from Linq to Sql to AR near the end of a project, and didn't have the time to properly learn AR/NHibernate before I started using it. As for advice on what the

Re: Castle AR, getting data from DB, not the cache

2009-05-26 Thread Markus Zywitza
You have a few possibilities: 1) If you are not using lazy loading, a WinForms application works well without SessionScopes. This opens a session per operation with instant refreshes per read. 2) If you are using large amounts of data, you will need lazy loading and session scopes. In this

Re: Castle AR, getting data from DB, not the cache

2009-05-26 Thread vekaz turkovic
Hi Jason, Thank you for your reply. That is not harsh at all. I am well aware of the mistake I made. I was so frustrated with linq, that I just had to drop it and quickly replace it with something else. Even without any previous experience with NHibernate/AR, it seemed far more intuitive and

Re: Castle AR, getting data from DB, not the cache

2009-05-26 Thread volker
I know what you mean when you talk about confusion. There is not much real information out there about session management in windows forms applications. I by now use a Session per use case and/or a Session per form and it works good. Sure it has a little overhead since you have to re - Get an

RE: Castle AR, getting data from DB, not the cache

2009-05-26 Thread Henrik Feldt
To: castle-project-users@googlegroups.com Subject: Re: Castle AR, getting data from DB, not the cache Hi Jason, Thank you for your reply. That is not harsh at all. I am well aware of the mistake I made. I was so frustrated with linq, that I just had to drop it and quickly replace it with something

Re: Castle AR, getting data from DB, not the cache

2009-05-26 Thread Jason Meckley
you definately don't want 1 session per application. 1 session factory yes. the main problems most encounter with NH/AR is select n+1 and too many db writes select n+1 can be avoided by using fetchmodes (eager, select, etc) db writes can be reduced (depending on pk type) by use ado.net batch