The application throws the error on Windows Server 2003 SP1, but not on Windows XP SP2.
Also to note: version 0.9 works just fine...
I would appreciate some help on this...
Thanks!
Hibernate version: 1.0.0 & 1.0.2
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="MVCDemo.OrderDetails, MVCDemo" table="OrderDetails">
<id name="OrderID" column="OrderId" type="integer">
<generator class="assigned" />
</id>
<property name="ProductID" column="ProductID" type="integer"/>
<property name="UnitPrice" column="UnitPrice" type="Decimal"/>
<property name="Quantity" column="Quantity" type="integer"/>
<property name="Discount" column="Discount" type="Double"/>
<many-to-one name="Product" class="MVCDemo.Products, MVCDemo" column="ProductID" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
public Employees authEmployee(string strUserID, string strPWD)
{
ArrayList alEmp = new ArrayList();
NHibernateHelper nhHelp = new NHibernateHelper();
Configuration cfg = nhHelp.getConfiguration();
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
session = factory.OpenSession();
// Employees emp = (Employees)session.Load(typeof(Employees), strUserID);
Employees emp = new Employees();
alEmp = (ArrayList)session.CreateCriteria(typeof(Employees))
.Add(Expression.Eq("UserID", strUserID))
.Add(Expression.Eq("Password", strPWD))
.List();
session.Flush();
session.Close();
return emp = (Employees)alEmp[0];
}
Full stack trace of any exception that occurs:
MappingException: Repated column in mapping for class MVCDemo.OrderDetails should be mapped with insert="false" update="false": ProductID]
NHibernate.Persister.AbstractEntityPersister.CheckColumnDuplication(ISet distinctColumns, ICollection columns) +217
NHibernate.Persister.EntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory) +2957
NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ISessionFactoryImplementor factory) +59
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, Settings settings) +537
NHibernate.Cfg.Configuration.BuildSessionFactory() +90
MVCDemo.EmployeesDaoHImpl.authEmployee(String strUserID, String strPWD) in C:\DemoWebs\MVCDemo\Persistence\Implementations\EmployeesDaoHImpl.cs:44
MVCDemo.EmployeesFacadeImpl.authEmployee(String strUserID, String strPWD) in C:\DemoWebs\MVCDemo\Services\Implementations\EmployeesFacadeImpl.cs:43
MVCDemo.Login.Page_Load(Object sender, EventArgs e) in C:\DemoWebs\MVCDemo\Login.aspx.cs:56
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
Name and version of the database you are using: MS SQL Server 2000
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|