Seems like an excellent idea to me.
We have been stuck using the older version of NHibernate as we are doing project specific work right now. We don't have the time to go back and re-engineer the framework to the new NHibernate v1.20.
Give it a try!
I took the ZIP and it builds fine for me.
Did you make any code changes? Or did you just update the references?
Did you change any code to take advantage of any of the new features in NHibernate v1.2 to support generics?
Don't worry about the formatting. We obviously have different style settings for R#, since that's what we use as well.
I, incorrectly as it turns out, assumed that you were also going to look at how to use the new generics stuff as well.
That will obviously have to wait for another day!
There should be no reason why it shouldn't work with WCF. NHibernate is used only to populate the objects with data from the data base.
If you have a problem with remoting and WCF then it's likely that you haven't configured the various parts of the Data Portal functionality correctly.
Double check all your WCF configuration settings and make sure you can get the Data Portal working without NHibernate. Then add NHibernate into the picture. That might help you isolate the problem.
However, having said all that we haven't gone up to the latest version of CSLA yet that takes advantage of the WCF stuff. So there may be a problem that we haven't seen yet.
ProjectList.cs
protected override void SetNHibernateCriteria(object businessCriteria, ICriteria nhibernateCriteria){
// Cast the criteria back to the strongly-typed version
Criteria criteria = businessCriteria as Criteria;
// If it's a valid criteria object then check for filters
if (!ReferenceEquals(criteria, null))
{
// Set a reference to the NHibernate ICriteria (for local use only)
_iCriteria = nhibernateCriteria;
// Name
if (!String.IsNullOrEmpty(criteria.Name))
{
AddCriterionName(criteria.Name);
}
}
}
I think something is wrong here.when i remark these ,it's all right.
Well there's nothing wrong with that line of code specifically. And you've not given any idea of what the problem is and how it's being manifested.
However, that line of code is just doing a simple assignment operation to a private field, so that the AddCriterionName() method can use the field.
It can be refactored easily so that the ICriteria is passed as a parameter to the AddCriterionName(ICriteria nhibernateCriteria, string Name) method instead. Then the private field can be removed.
some details is here
I read the other thread. And yes, it sounds to me like you found the right problem - Serialization.
Any BO that needs to move via the Data Portal has to be Serializable. And sometimes that means you might need to mark specific fields with the [NonSerialized] attribute.
I hope you solved your problem.
I am looking into writing some templates to support NHibernate in Code Complete. I am not very familiar with NHibernate so I have a couple of questions and I would appreciate any help:
1- How is NH used with CSLA i.e. does everyone use the version by David Dilworth available on CodePlex?
2- Which version is currently available as a release?
Thanks
Philip
I'm just replying to this so that people who come to this thread will find out that I have moved on to a new job and I am no longer involved in the project that used CSLA and NH together. As it happens, I'm still using NH, but with an in-house developed middle tier. I still get the occasional CSLA email and I do check back onto the forums occasionally - there are some very knowledgable people on here!
So in answer to your questions:
(1) I don't know, but I expect some people will have taken the original CodePlex code and modified it for their own projects. That's great, it was always meant to be a starting point to give people an idea of how CSLA and NH could be integrated together.
(2) NHibernate is at version 1.2.1. Check out the NHibernate website for the latest updates. As for the latest version of the CSLA/NH extensions - I'm not sure anymore.
HTH
And good luck!
Copyright (c) Marimer LLC