Summer of NHibernate Screencast Sessions
If you’re here to download one or more of the Summer of NHibernate video screencast series that I have been recording and making available, then note that all this content is most easily accessed now from its own site at….
This domain was setup so that the content is dirt-simple to access and download for anyone interested.
Donations to cover bandwidth costs
If you are enjoying the content that is provided, I would appreciate it if you would consider making even a small donation to help me cover the bandwidth and content hosting costs of these video screencasts.
Although video is an excellent training medium, the large files do result in some hefty bandwidth and disk usage costs for myself — if you are getting value out of the content, then even a moderate donation would be appreciated.
Following is a link to make a donation via my PayPal account if you are interested in contributing to help offset some of these costs. Please note that you do not need to have your own PayPal account to make a donation, only a credit card or a checking account is required.
Thanks in advance for your consideration.
[…] Summer of NHibernate […]
Hi,
It’s good to see you taking the plunge with the new website and new blog ๐
There is one thing though – could you put whole posts in the atom feed, not only headers?
Its a work in progress and I’m experimenting with a way to accomplish this better. When I initially attempted to do as you suggest (since I too prefer to read whole posts in my RSS reader vs. having to visit ea. site to read the posts) my own RSS reader choked on the feed b/c my hosting company couldn’t spit back the feed fast enough when it contained some of my embedded screenshots.
I am continuing to experiment with settings to address this, so hopefully, yes– this will be coming soon.
Hi
In your last summer videos, you are using a template called “Microdesk NHibernate Template 1.1” in order to auto-gen code. Is this template public and where do I find it? would love to use it:-)
/Claus
@Claus:
Its in the root of the \DataProvider folder in the code download that accompanies that session. The template is uncompiled text in this instance, so feel free to use. modify, or whatever suits you.
-Steve B.
Hi,
we can I get I copy of the databases (DineandDiscuss) you use in your videos and code?
Cheers,
Oscar
@Oscar There is a DDL file in the source for generating the db. But yes it would be good if there was a data script as well. Think I just looked at the xsd provided and entered the required rows manually to get the samples to work after the second or so vid.
@Oscar:
That’s really an interesting point; surprised I overlooked that. Here’s a way around it tho…
1) Use the DDL to build the DB (an empty DB inatance)
2) the ‘test data’ in already in the testdata.xml file from the code downloads so you can use the NDbUnit library to mass-load it into the DB — there is even a convenience method exposed by the DatabaseUnitTestBase abstract class from the Microdesk.Utility.UnitTest.dll called ‘LoadTestDatabase()’ which will load the testdata.xml file content into the DB (assumes the DB is already empty, so please ensure that’s true before you invoke this method).
This is, I think, why I never bothered to post actual DB content-loading scripts with the code samples; assuming you run the DDL to create the DB, the tests will all ‘just work’ since the infrastructure should be having no problem loading the test data in from the testdata.xml file before the tests.
Hope this helps~!
I really appreciate your efforts for doing this screencast series. I have just one request (that might actually help you as well). Please provide low-resolution videos (640*480 or 800*600 maybe) as there are people who actually still use smaller screens / lower resolution displays and its really hard to view the text in the videos that you’ve provided.
Videos in lower resolutions will also save you bandwidth if you consider to provide those.
Thanks anyhow.
@I Write Code:
Thanks for the feedback; this issue has actually been mentioned to me several times by others as well.
The challenge with this approach is several-fold:
1) These videos are first intended for consumption by our own internal staff and are being made available secondarily to the community. As such, any change in format that reduces their value to our internal staff is generally not going to be adopted. I have made some format changes (e.g. to WMV instead of AVI) in response to such suggestions, but reducing the resolution below 1280×1024 is something that I have rejected in the past as being too detrimental to our own users to be pursued.
2) Trying to run Visual Studio capably in a 1024×768 is only marginally possible without ALOT of scrolling, etc. and it goes without saying that 800×600 is an order of magnitude worse and 640×480 is just out of the question (for me). I’m tyring not to be a ‘hardware snob’, but if you are developing (even not-for-profit) at lower than 1280×1024, you owe it to yourself to procure a higher-resolution working environment. I understand that this may not be possible for everyone and indeed there are those running @ those low resolutions for what I’m sure are very good economic reasons, but there comes a point at which I have to strike a balance between usability and effective content and I just don’t see how running these @ that low a resolution would result in valuable content to as many people (even if, as you point out, it would further reduce the bandwidth needed to distribute them).
That said, you are free to download the content and re-encode it at a resampled lower resolution using any one of available free tools out there. I can recommend http://www.erightsoft.com/SUPER.html as a very effective and completely free multimedia encoder that you can use to reduce the resolution of this content to whatever suits your needs.
Best of luck and thanks for the continues interest,
-Steve B.
Just want like to say thank you for sharing your knowledge.
You have done a fantastic job in this techinical video.
Itโs one of the best technical training I have in years.
I have learned a lot from it and itโs well complement with the material that I have read(NHibernate in action etcโฆ..).
You did a very good job explaining such a complex framework like NHibernate. Concise and meaty content.
I would to love hear your thought on Entity framework vs NHibernate.
Which is the better framework as a developement platform moving forward.
Current I am using CSLA framework for my project and would like to leverage ORM framework to do the CRUD operations.
Any suggestion/gotcha/tips for CSLA and Nhibernate?
Waiting for session 11 to be posted.:)
Keep up the good works!
Great series. Really enjoyed the ones I’ve watched so far. I tried to (jump ahead) and download session 8 on ddd (an area that interests me) but it’s not there. Is that because the link is broken or you haven’t uploaded it yet?
@Hammerlp:
The links to session 08 work fine for me (the video and the code sample). Can you…
a) try again
b) advise exactly what error you are receiving so I can try to resolve it for you
WOW, I just came across this and i’ll be watching the entire series tonight. Keep up the great work!
@Kevin:
Glad to hear it, but the series is 15 sessions X about 1.5 hours each so you’re gonna need more than a single night ๐
Hope you find value int he content~!
not exactly about the subject but i cant stop myself ๐ No one mention about the musics you used in the casts, i think they are also great ๐ by the way, whose song is it playing at the end of the each cast ?
@Gokhan:
With the Summer of NHibernate series the intro and outro themes are both excerpts from O Fortuna (http://en.wikipedia.org/wiki/O_Fortuna) as performed by an anonymous symphony orchestra (they aren’t really anonymous, of course, but I just cannot recall which performance I grabbed the music from).
In the Autumn of Agile series, I went a little bit differently, using two different themes for the intro and the outro music. The intro is the theme from a (sadly) short-lived American TV series called ‘Nowhere Man’ (http://en.wikipedia.org/wiki/Nowhere_Man_(TV_series)) from many years ago that I took a liking to. I may have been about the only one to like it, as it was cancelled after its first season ๐
The outro theme for the Autumn of Agile series is from the soundtrack of the Bourne (Identity, Ultimatum, Supremecy) movies as is entitled ‘Extreme Ways’ which I felt accurately captured the intent of the Agile/Extreme approach to programming.
Thanks for the screencasts, great job!
In chapter 8 you auto generate code for both DT classes and mappings. Those classes should have all their properties defined as virtual, otherwise lazy loading doesn’t work. However, files generated by me and those supplied in the code section of the chapter have Clone, IsDeleted, IsChanged methods that aren’t virtual and hence tests don’t run on my machine, but somehow run on yours. Do you have any explanation why it works this way?
Thanks again.
@Daniel:
Yes, actually ๐ The Smart Money says that you are actually doing something quite different on your side than I am on mine: you are almost certainly using NH 2.x instead of NH 1.2
One of the breaking changes in NH 2.x is that ALL public methods and properties need to be VIRTUAL instead of just those that correlate to a mapped (persisted) property. In NH 1.2 this constraint only applied to those properties that mapped to persisted values.
This is actually a GOOD thing, even though depending on the ‘shape’ of your peristed objects it might be a breaking change for you (as is the case with the code-gen-ed classes from that template). If you think about it, without this requirement there are edge-cases where your code could call a public method on a class that made use of a value in the PRIVATE field backed by a persisted property and NH would be unaware that it then needed to use lazy-loading to resolve the proxied property since access to the value DIDN’T go thru the proxied property accessor but instead got at it via its PRIVATE backing field in the class.
By requiring that all public methods and properties are virtual (at least when using the default approach to lazy-loading/proxying NH provides) you are ensured that even a call to a public method that relies on a proxied private member is handled correctly.
Bottom line: if you switch back to NH 1.2 I’m near-certain that your code will work just fine. To use NH 2.x you will most definitely need to ensure that the entire public ‘surface area’ of your persisted objects is declared virtual to get past this more comprehensive check that NH 2.x performs to ensure your classes are properly proxy-able.
Hope this helps and let me know if this addressed your issue; its POSSIBLE something else is going on here, but my first guess is that you are using NH 2.x instead of NH 1.2 as the demo code (in that installment) does.
Just wanted to let you know that I loved the NHibernate screen cast series. I’ve been using NHibernate during the past 11 months on my current project and initially relied on reading documentation to figure it all out, but your videos made it so much easier.
I’ve learned so much from reading your blogs that it has re-kindled my interest in software development. I’m currently tuned into your Autumn of Agile series …can’t wait for the next post.
Thanks again!
Steve,
You’re absolutely right, I’m using NH 2.0 and this is the reason why tests on my machine don’t work when using auto generated classes. I adjusted the template a bit and now it works just fine.
I completed watching the series and want to thank you again for the great job you have done.
Daniel.
Hi Steve,
I’m very love the series video of NHibernate.
And I want to know the name of the tool which you used in Vistual Studio to auto generation code, auto update variable name?
i.e. when you input a property’s name, then it complete the Get/Set methods.
Thanks.
@Zhiming:
Glad you’re enjoying the content. I have blogged several times about the tools used in the screencasts; links to all of the posts can actually be found in my reply to this commnent here:
http://unhandled-exceptions.com/blog/index.php/official-bio/#comment-10761
Have fun~!
Okay, I created a torrent for you (2.65Gb) and seeded until I’d uploaded 10x. I have bandwidth constraints too. ๐ I’ll share the file with someONE else who can seed for a while, but I’ve stopped the seed in my p2p client. It took six months to seed 10x so maybe it’s not a popular distribution channel anyway.
You have my email address so please feel free to connect with me if you want.
Thanks again for posting!
while trying to simulate the examples in session 8, my mappings aren’t not pulling up as many to many from productOrders. Any suggestions. Also I changed the code to allow me to keep underscores in the column names, such as Customer_k. is the existing behavior there for a reason. Is there some bad juju going to happend to me because of my change. Steve I’ve worked every lesson through 8 and so far the SONH f’n RULES. I’ve learned a ton. Thanks
@Bob:
There’s no reason at all that retaining the underscores in your column names would cause any troubles (since that’s 100% supported both in SQL Server and in C#) so I don’t think that’s the problem.
If you’re still stuck, the the NHUsers Google mailing list at…
http://groups.google.com/group/nhusers?hl=en
…and post your classes and your mappings in a message there; participants are usually more than willing to take a look @ your work and let you know where you have gone astray.
Best of luck,
-Steve B.
I have watched two of the videos about Nhibernate and found them extremely clear and helpful. I have a question about video 13 which is about using Nhibernate with ASP.Net. When using the SessionPerConversation, I understand why after the initial postback every subsequent postback would be using a different session so the in session = false is displayed on the screen. But I do not understand why when you type in the URL and start over, why now it would not be referencing the same session on the postback if a new session would have been saved. It still displays with in session = false. I hope you understand my question.
One other question that I have is if the hhibernate session is saved in the session state, if you have retreived a long list of objects wouldn’t that add tremendous overhead to the page.
Thank you
Judith Barer
Hi Stephen,
Just to say your screencasts are absolutely brilliant and have been very helpful. Ive only managed to watch two but’ll try to watch all. I may start to feel so guilty ill even have to donate something though ๐
Cheers
Martijn
Hi Stephen,
These videos are very useful especially for us beginners, I am currently watching the first session โSetup Basic and Usage Patternโ. And I have a question, at around 21:44 of the first video, the part where you are creating the โCustomerโ Class. Are you using a Visual Studio Add-in? Wherein properties are automatically created? If you are could you tell me what it is? Thank you. ๐
Reggie
@Reggie:
That’s a combination of CodeRush + Refactor Pro from Developer Express. For a comprehensive list of all the tools you see me using in the screencasts, see this post: http://unhandled-exceptions.com/blog/index.php/2008/07/16/confessions-of-a-developer-tool-hound/
Glad you’re liking the content; thanks!
-Steve B.
@Judith:
I’ll have to replay that video and let you know…I’m not certain from your description that I entirely understand the behavior you’re describing but I will review it and get you an answer as soon as I can.
Re: storing the NH session in ASP.NET Session-state, yes you are 100% correct that a large object-graph and/or a large qty of objects in there would (potentially) represent significant overhead on the server in re: size of session-state.
This is really why this usage pattern was demonstrated along with the session-per-request pattern: they both have a place in your ‘toolbox’ but they both (like so many things in software development) represent trade-offs between positives and negatives for your solution. When *needed* session-per-conversation can be very powerful and incredibly useful but if used indiscriminately it can definitely lead to just the problems you describe.
HTH,
-Steve B.
Hi, I like the look of your Visual Studio coding pane where it has the vs icons next to the class, methods and such. How do you get Visual Studio to display that?
Oh yeah, great screen cast, got me using NHibernate in a short amount of time.
Thanks.
-Bernard
@Bernard:
That’s CodeRush by Developer Express. For a complete list of the tools seen in the screencasts, visit this post: http://unhandled-exceptions.com/blog/index.php/2008/07/16/confessions-of-a-developer-tool-hound/
Glad you were helped out by the content~!
-Steve B.
i live in iran and i can not download your movies and your site can not open please up your movies in rapidshare thanks
Great Videos.
ASIDE: What addin are u using with VStudio 2k8. Looks pretty cool?
@asif:
All of the tools seen in the videos are listed here: http://unhandled-exceptions.com/blog/index.php/2008/07/16/confessions-of-a-developer-tool-hound/
The specific one to which you are referring is (probably) the combination of CodeRush + Refactor! Pro from Developer Express. Note that they have since released a CodeRushXpress version of their tools that is 100% completely free and offeres some of the same functionality as their for-fee products so even if you opt not to pay for a commerical license of the tools, you should still download + install the freeware CodeRushXpress toolset from them.
Happy coding,
-Steve B
Hi Steve,
Love you videos. But there is a minor glitch i am facing with the code. For some reason whenever i run the code it does not go into the [Setup], TestFixtureSetup, Teardown etc methods. Any ideas what is happening here.
regards
pat
Hi Steve,
Solved the problem. Found that i was using an older version of mbunit (gallio).
But, I am still unable to run the tests . It is failing in TestFixtureTearDown & Setup. The error message is “The DELETE statement conflicted with the REFERENCE constraint ”
regards
pat
Hi the nibernate template that you are using, what changes do i need to make it work for 2.1.0.
Thanks
Asif
@asif:
In general, you need to ensure that your objects’ public API is consistently declared ‘virtual’ and the templates are likely to work fine with NH 2.1 (more or less).
Note that I no longer use the code-gen approach to generating mapping files -or- objects so I cannot speak from experience but only from feedback that others have provided me about how *they* have modified the templates themselves.
Hope this helps,
-Steve B.
Loving the videos! Very informative and descriptive. Good starter for anyone wanting to learn NHibernate.
Although, if I hear “go on ahead” one more time I’m going to go crazy! ๐ I counted them for fun in the Session 3 video as I watched. You said “go on ahead” 145 times! In 1 hour 10 min video, thats about one every 30 seconds.
Anyway, keep up the good work Steve and thanks for these videos.
@Jhenry:
Yes, it rather appears that one side-effect of my having produced these videos is that its provided lots of opportunity for people to point out that particular ‘verbal tick’ of mine ๐
FWIW, its served to make me more aware of it and I have just about managed to stamp it out of my lexicon for good now…although we’ll all get to see how well (or not!) when I resume the Autumn of Agile series later this year!
Thanks for the f/b~!
-Steve B.
Hi Steve,
many thanks for these screencasts, they are awesome for somebody like me wanting to discover NHibernate.
But I was facing to a problem : During last test in session 03 ( CanSaveOrUpdateCustomers , running the test alone worked fine, but running all the tests make it failed.
After some research, NHibernate seemed to “remember” the state of first customer – modified during CanUpdateCustomer – causing a quite disturbing thing :
While the SQL was “select from customer where Firstname = “Steve” “, the first returned object had “SteveSUFFIX” as firstname for NHibernate.
A call to _session.Clear() through provider to clear object cache after a “CleanInsertIdentity” fixed the problem restoring tests indepedence. But It takes me some time to figure it out. ( I use NDbUnit directly in order to make all this stuff work with VS Express or MonoDevelop. )
Hope this can help others, and please explain to me why you don’t need this trick.
Ok seems that Session 4 answer my question. Sorry. ๐
@hvannentir:
Glad you were able to work it out ๐
Hello Steve,
I Love your NHibernate Video Series. I want to know how to do bulk operations{Bulk Insert} with NHIbernate2.1 . i had set adonet_batchsize=1 to enable batching but it still asking me to enable batch size ? Please anybody suggest me how to do Bulk insert efficiently.
Ibrahim(india)
Hello,
first of all thank you VERY much for this awesome screencast series!
I really appreciate your effort.
I’m having a tiny issue with the SQL output of nHibernate.
It seems to me that only SELECT / INSERT statements are outputted.
When I try to test CanSaveOrUpdateCustomers, then I can only see one SELECT in the beginning, then two INSERTs and a final SELECT in the end of the statement list.
I don’t know if this problem is related to the versions I’m using (nHibernate 3.3.3, mbUnit 3.4.0.0, VS 2010).
Do you have any hint?
Thank you VERY VERY MUCH!!