Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

NHibernate 2.0 + and Cuyahoga Options
Constructor
Posted: Monday, December 15, 2008 11:51:51 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Is it possible/howmuch work is it to add the latest (http://nhibernate.svn.sourceforge.net/viewvc/nhibernate/trunk/) NHibernate to Cuyahoga. There is a bug fix in there (fix for NH-1608) that I would like.

What are the major implications of this endertaking?

I am asking as I would like to resolve this: http://stackoverflow.com/questions/367119/nhibernate-child-objects-update-problem

martijnb
Posted: Tuesday, December 16, 2008 12:47:29 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
I'd give it a shot by replacing the NHibernate dll's. You'll have to add a binding redirect to the web.config like in this example. The newVersion should reflect the version number of the NH trunk.
martijnb
Posted: Tuesday, December 16, 2008 2:21:01 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Hmm, I just noticed there are some breaking changes in NH 2.0. This will at least require some modifications in Cuyahoga.Core.
Constructor
Posted: Tuesday, December 16, 2008 2:37:49 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Yeah, so have I. I have made some changes:

//using NHibernate.Expression; Removed because of NHibernate Version Changes
using NHibernate.Criterion;

But I still get:

The type 'NHibernate.ISession' is defined in an assembly that is not referenced. You must add a reference to assembly 'NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'.

C:\Inetpub\wwwroot\CuyaModuleTests\Core\Service\CoreRepositoryAdapter.cs
Cuyahoga.Core


I have added this to the web.config

<runtime>
<assemblyBinding xmlns="urnconfusedchemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="1.2.0.4000" newVersion="v2.0.50727" />
</dependentAssembly>
</assemblyBinding>
</runtime>


But I am not sure about the version number.
Constructor
Posted: Tuesday, December 16, 2008 2:43:19 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Still getting:

Error 85 The type 'NHibernate.ISession' is defined in an assembly that is not referenced. You must add a reference to assembly 'NHibernate, Version=1.2.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'. C:\Inetpub\wwwroot\CuyaModuleTests\Core\Service\CoreRepositoryAdapter.cs 31 10 Cuyahoga.Core
Constructor
Posted: Tuesday, December 16, 2008 4:14:25 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Had a look at this and got back to the Castle source and it is using NHibernate.Expression;

This is now NHibernate.Criterion in the latest version.

So this tells me that it would be far too much to do.

Unless I am completely incorrect?
martijnb
Posted: Tuesday, December 16, 2008 8:34:41 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Castle trunk uses NHibernate 2.1.0.1001. Maybe, you could build Castle from the trunk and then replace the dlls in Cuyahoga /lib. Personally, I haven't build the Castle trunk in a while, so I don't know how easy it is nowadays.
Constructor
Posted: Tuesday, December 16, 2008 9:18:21 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Ok, will give that a try now...
Constructor
Posted: Tuesday, December 16, 2008 3:41:15 PM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
After hours of digging...

I got Castle to build the required .dll files to try and replace them in Cuyahoga.

I Moved them to the core and proceeded to try and build.

Error 13 'NHibernate.ISessionFactory' does not contain a definition for 'Dialect' and no extension method 'Dialect' accepting a first argument of type 'NHibernate.ISessionFactory' could be found (are you missing a using directive or an assembly reference?) C:\Inetpub\wwwroot\CuyaModuleTests\Core\Util\DatabaseUtil.cs 34 25 Cuyahoga.Core

and

and Error 15 'NHibernate.ISessionFactory' does not contain a definition for 'ConnectionProvider' and no extension method 'ConnectionProvider' accepting a first argument of type 'NHibernate.ISessionFactory' could be found (are you missing a using directive or an assembly reference?) C:\Inetpub\wwwroot\CuyaModuleTests\Core\Util\DatabaseUtil.cs 130 48 Cuyahoga.Core


I think I will just make do with what I have!

Is Cuyahoga in development still? If so is there roadmap info on a website somewhere? Or if there is nothing so concrete, what are the general ideas for the future direction?
martijnb
Posted: Wednesday, December 17, 2008 1:45:36 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Constructor wrote:

Error 13 'NHibernate.ISessionFactory' does not contain a definition for 'Dialect' and no extension method 'Dialect' accepting a first argument of type 'NHibernate.ISessionFactory' could be found (are you missing a using directive or an assembly reference?) C:\Inetpub\wwwroot\CuyaModuleTests\Core\Util\DatabaseUtil.cs 34 25 Cuyahoga.Core

and

and Error 15 'NHibernate.ISessionFactory' does not contain a definition for 'ConnectionProvider' and no extension method 'ConnectionProvider' accepting a first argument of type 'NHibernate.ISessionFactory' could be found (are you missing a using directive or an assembly reference?) C:\Inetpub\wwwroot\CuyaModuleTests\Core\Util\DatabaseUtil.cs 130 48 Cuyahoga.Core


After your post yesterday, I gave it a try and I ran into the same issues. It seems that Castle trunk uses some special build of NHibernate that misses these properties.
In Castle I replaced the custom NHibernate dll with 2.0.1 GA and modified the NHibernateIntegration facility so that it doesn't use ActiveEntityMode anymore. I also excluded ActiveRecord from the build, because we don't need that anyway.
Now, I'm using this build in the trunk and it seems to work fine. It also gives me some nice new features like fluent registration of components in Windsor.

Quote:

Is Cuyahoga in development still? If so is there roadmap info on a website somewhere? Or if there is nothing so concrete, what are the general ideas for the future direction?


It sure is in development at the moment. There is no official roadmap, but globally speaking, Cuyahoga 2.0 will have a new multi-language admin interface in ASP.NET MVC, more generic handling of content and is truly multi-site with separate content directories, templates, full-text indexes and roles per site. You can check the new stuff in the SVN trunk: https://cuyahoga.svn.sourceforge.net/svnroot/cuyahoga/trunk/
Constructor
Posted: Wednesday, December 17, 2008 3:34:38 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
Sounds great, I am getting the src now.

I would like to get a greater, in depth understanding of how the system is put together. I understand module development but now I wish to understand the system itself, and the architecture a lot more.

Any information that would help greatly appreciated.

I will look at what you said about Castle as I want the latest fixes from NHibernate. Child objects that are referenced don't refresh. I don't want to use a redirect to the same page just to get past this.

I have also in my version the RegisterJavascript() method which acts the same as the css registration as well as 'apply template to all nodes in site'.

This was to enable js file registration to the page for making my jQuery module (a mixture of content management and presentation using various plugins). Select the presentation method in the admin, configure your content and add to page.

Also... There is now an ExecuteUpdate(), see: http://www.cuyahoga-project.org/home/forum.aspx?g=posts&t=1128

Great news.
Constructor
Posted: Wednesday, December 17, 2008 8:21:59 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
martijnb wrote:

In Castle I replaced the custom NHibernate dll with 2.0.1 GA and modified the NHibernateIntegration facility so that it doesn't use ActiveEntityMode anymore. I also excluded ActiveRecord from the build, because we don't need that anyway.
Now, I'm using this build in the trunk and it seems to work fine. It also gives me some nice new features like fluent registration of components in Windsor.


Does the same work with this version of NHibernate?:

https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/

If I use the Cuyahoga trunk and swap the NHibernate dll it does not work.
martijnb
Posted: Thursday, December 18, 2008 1:04:12 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
It looks like they changed ISessionFactory. It doesn't have the Dialect and ConnectionProvider properties anymore. This is required for the installer to figure out the database type. I already had this problem with the Castle private build and it seems this is also going to be this way in NH 2.1.

Probably there is a new way to figure out the current Dialect, but I can't find it.
Constructor
Posted: Thursday, December 18, 2008 3:37:11 AM
Rank: Administration
Groups: Administration , Member

Joined: 10/7/2008
Posts: 505
Points: 1,515
I may be wrong but my version has both 'NHibernate.Connection.ConnectionProvider' and 'NHibernate.Dialect'.

Anyway, I have reached the point where I do not know enough about the inner workings of NHibernate, Castle or Cuyahoga to go further. So I will continue to try and learn as much as possible to understand how the three work together.

If there are any resources/info you can point me to that you think could help me get there as fast as possible I would be greatful.

Your time and effort is appreciated. Thanks.


Also: http://code.google.com:80/p/fluent-nhibernate/

I am looking at this now. This should work with the trunk (as you said in earlier post I think).
martijnb
Posted: Friday, December 19, 2008 3:23:48 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Constructor wrote:

Anyway, I have reached the point where I do not know enough about the inner workings of NHibernate, Castle or Cuyahoga to go further. So I will continue to try and learn as much as possible to understand how the three work together.


I feel your pain. The version issues are sometimes driving me nuts.

Grimace of Despair
Posted: Tuesday, January 6, 2009 2:14:08 AM
Rank: Newbie
Groups: Member

Joined: 1/6/2009
Posts: 4
Points: 12
I ran into the very same issue. I've now patched my local Cuyahoga repo to return a SessionFactoryImpl from GetNHibernateSessionFactory (see Cuyahoga.Core.Util.DatabaseUtil), because they've _not yet_ synchronized the implementation with the interface. I hope they will forget about that happy

So with some minor tweaks, you can still get Cuyahoga to build and run from the trunk. For now...
martijnb
Posted: Tuesday, January 6, 2009 10:59:12 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Thanks for the update.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.