nhibernate

How to make NHibernate <array> to have fixed size

I'm using a mapping of IList to array in NHibernate, and I want the array to always have constant, fixed size. However, it is valid that some elements in the array are null. I noticed that in this case, NHibernate truncates the null elements at the end of the array. How can I enforce it to always set the array to appropriate size when ...

Nhibernate: Uninitialized proxy passed to save

Hi all, I've got a problem with NHibernate. The error message is: Uninitialized proxy passed to save [PersistentObjectException: Uninitialized proxy passed to save(). Object: ......Domain.Model......] NHibernate.Event.Default.DefaultSaveEventListener.ReassociateIfUninitializedProxy(Object obj, ISessionImplementor sou...

Protected and/or Internal Component Properties in NHibernate

The docs for NHibernate clearly state that properties (and I assume, by extension, components) with any access modifier can be mapped. However, this is not the behaviour I'm seeing, and I'm wondering if anybody can tell me if this is my mistake or if it is the result of some poorly-documented behaviour in NHibernate. The component clas...

GoDaddy.com shared hosting with NHibernate and MVC 1.0

I'm getting the following error after a migration to shared hosting on godaddy.com [SecurityException: Request failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed...

NHibernate: How do I XmlSerialize an ISet<T>?

Given: I'm trying to create a REST API using ASP.NET MVC. I'm using NHibernate in my data access layer. Problem: I'm can't XmlSerialize ISet properties. I get errors like the following: Cannot serialize member [namespace].[entity].[property] of type Iesi.Collections.Generic.ISet`1[[namespace].[entity], [assembly], Ver...

How similiar are the implementations of hibernate and nhibernate?

How similiar are the implementations of hibernate and nhibernate? i.e. if I am comfortable with nhibernate, will hibernate be a very easy transition? ...

StructureMap: CacheBy(InstanceScope.Singleton) question

Hi, I have a question about how InstanceScope.Singleton works, because I am getting some unexpected results here: I have a service that is dependent on Dao public MetaProjectService(IMetaProjectDao metaProjectDao) { _metaProjectDao = metaProjectDao; } and I have Dao that is dependent on ISession (Nhiberna...

Help with NHibernate Insert/Update

I am new to NHibernate and have found it extremely interesting. I have been trying to persist objects to a mapping table (the table that breaks a many to many relations in the relational database design) but not been able to do so so far. I am able to retrieve data from the mapping table using my current hibernate-mapping, though. Here ...

Advice to start with Nhibernate on C#: documentation, books and any other good learning resources.

I need to learn nHibernate from scratch. I'm a experienced .net developer, but I need some advices about using and implementing nHibernate on .NET apps. Any documentation or book you consider I "must read", or any other advice will be appreciated. Thanks in advance! ...

How to configure NHibernate class mapping from IronPython?

I try to use NHibernate from IronPython. I have copied the NHibernate dependencies to my C:\Users\shamel\python\HelloPy\libs directory. I have this IronPython code: import sys sys.path.append("C:\Users\shamel\python\HelloPy\libs") import clr clr.AddReference("NHibernate") clr.AddReference("LinFu.DynamicProxy") clr.AddReference("NHibe...

Can I use IList instead of ISet?

I don't want to use ISet since its not a native collection. Could I get away with using IList? My relations all have primary keys, and any time they don't I am not using that collection to modify the database etc. (the parent collection will handle any db updates/cascades etc). ...

does adding the type to each property in the nhibernate mapping file improve performance?

if I add the type="Int32" etc. in the mapping file, will it speed things up? ...

Does the NHibernate session object use allot of server RAM?

Does the NHibernate session object use allot of server RAM? It depends on website traffic, but does the session object get very big in terms of memory usage? ...

NHibernate: Criteria Issue with parameter type

I have a varchar field in a table, mapped to string property on a class. Pretty simple stuff, however when I create a criteria to retieve enities based on this field, NHibernare is generating invalid sql. The where clause looks like "Where accountnum = 120001", which won't work with a varchar obviously. Any ideas? ...

For me to use Moq, do all my classes have to implement an interface?

I want to use Moq, but I am using Nhibernate and I didn't create interfaces for all my Model classes (POCO classes). Do I have to create an interface for each class for me to be able to moq my POCO classes? ...

Moq: Invalid setup on a non-overridable member: x => x.GetByTitle("asdf")

Not sure how I can fix this, trying to do a unit test on the method "GetByTitle" Here are my definitions: public class ArticleDAO : GenericNHibernateDAO(IArticle, int>, IArticleDAO { public IArticle GetByTitle(string title) { IQuery query = Session.CreateQuery("...") return qu...

Linq to NHibernate : is it mature ?

Hi, I'm thinking about using Linq to NHibernate in an upcoming project, so I'd like some feedback about it. I found this identical question asked in February, and it seemed that Linq to NHibernate was not very mature at this time... Has it improved since then ? Has anyone used it in real life applications ? Thanks for your feedback PS...

Castle ActiveRecord: TransactionScope

Just a quick question about usage of TransactionScope in ActiveRecord. Is this something that is used and works or do people use some other method of handling transactions. I am not familiar, and I am not working with AC but I am thinking about adopting SessionScope and TransactionScope for my project, and was just wondering what people ...

Unit test using Moq doesn't pass, object is null, did I miss something?

The class I want to test is my ArticleManager class, specifically the LoadArticle method: public class ArticleManager : IArticleManager { private IArticle _article; public ArticleManger(IDBFactory dbFactory) { _dbFactory = dbFactory; } public void LoadArticle(string title) { ...

If you are using naitive identities, are objects persistant instantly?

In my asp.net application, I open and close/flush the session at the beginning/ending of each request. With this setup, I thought it would result in things like: Entity e = EntityDao.GetById(1); e.Property1 = "blah"; EntityDao.MakePersistant(e); e = EntityDao.GetById(1); e.Property1 // this won't be blah, it will be the old value...