nhibernate

NHibernate.ADOException: could not execute query --> System.IndexOutOfRangeException: id13_

假如想象 提交于 2020-01-07 03:15:06
问题 I've got a really simple class that is giving a strange error. It's quite simple one and has no relationship with another table. The strangest part is that seems to happen randomly but especially when my website had heavy load of requests... I use Nhibernate that is version 2.0.1.400. I had a search on net about it and most of them who had same problem say that is highly a bug of Nhibernate on forums... Anyone had have this kind of problem before? and came with a solution? Could this be a

NHibernate.ADOException: could not execute query --> System.IndexOutOfRangeException: id13_

99封情书 提交于 2020-01-07 03:14:25
问题 I've got a really simple class that is giving a strange error. It's quite simple one and has no relationship with another table. The strangest part is that seems to happen randomly but especially when my website had heavy load of requests... I use Nhibernate that is version 2.0.1.400. I had a search on net about it and most of them who had same problem say that is highly a bug of Nhibernate on forums... Anyone had have this kind of problem before? and came with a solution? Could this be a

NHibernate Query, using OfType and Subqueries

我的梦境 提交于 2020-01-07 02:53:25
问题 I'm trying to write a NHibernate Query which determines if a specified record is relevant to source of the request. In this case the specified record is a customer and a customer is relevant if they have any orders sourced from the specified source. I've had a go but the following query fails with a QuerySyntaxException . bool IsRelevant = Session.Query<Order>().Where ( ThisOrder => ThisOrder.Customer.ID == ThisCustomer.ID && ThisOrder.Items.OfType<SourceOrderItem>().Where ( I => I.Source.ID

nhibernate proxy generator

青春壹個敷衍的年華 提交于 2020-01-07 01:21:35
问题 I am attempting to get nhibernate working in medium-trust. What I found said that I needed to use a proxy generator. I pulled the one from nhibernate's site. When I attempt to use it, I recieve an error that it could not load the assembly 'DynamicProxyGenAssembly2'. Is there something I am missing or is there one that works somewhere. I would prefer not to use the generator, but there seems to be no alternative with nhibernate. 回答1: From what I gather the issue with medium trust is the use of

nhibernate proxy generator

青春壹個敷衍的年華 提交于 2020-01-07 01:21:31
问题 I am attempting to get nhibernate working in medium-trust. What I found said that I needed to use a proxy generator. I pulled the one from nhibernate's site. When I attempt to use it, I recieve an error that it could not load the assembly 'DynamicProxyGenAssembly2'. Is there something I am missing or is there one that works somewhere. I would prefer not to use the generator, but there seems to be no alternative with nhibernate. 回答1: From what I gather the issue with medium trust is the use of

NHibernate: Invalid index for this SqlParameterCollection

假装没事ソ 提交于 2020-01-06 15:53:31
问题 I'm getting an error "Invalid index... for this SqlParameterCollection" when I try to save my object with NHibernate. I've read a lot of answers about that problems but they either were about Fluent NHB or didn't seems to apply to my problem (I could be wrong about that). Here are my hbm and my class : <class name="MyWebSite.Model.ADUser" table="AD_USER"> <id name="Id" column="ID"> <generator class="native"/> </id> <property name="Login" column="LOGIN"/> <property name="Hidden" column="HIDDEN

Add SQL query options to NHibernate query

别说谁变了你拦得住时间么 提交于 2020-01-06 14:27:53
问题 I'm working with some code that generates ICriteria queries for NHibernate. They get executed using ActiveRecord and ActiveRecordMediator.FindAll() For certain queries, I need to optimise them by adding on an OPTION (HASH JOIN) hint at the end of the SELECT statement. Is there a quick way I can do this? I don't want to rewrite the queries using plain SQL. Well, I'd love to, but they're too complicated. But if, for example, there's an easy way I can trap and modify the SQL before it's pumped

how to iterate through an Icollection In MVC3 nhibernate

偶尔善良 提交于 2020-01-06 14:22:25
问题 i am developing an application in mvc3. I have two dropdowns and on the basis of value selected in first dropdown the second dropdown is populated. The first dropdown is Course and on the basis of course selected the second dropdown populates the states where the course is available. Foreg.if the course is 'MCA' the states should be Maharashtra,rajasthan and so-on. For this i have written an ajax function which is working fine. But the problem is i am not able to fetch multiple states at a

how to iterate through an Icollection In MVC3 nhibernate

梦想的初衷 提交于 2020-01-06 14:21:29
问题 i am developing an application in mvc3. I have two dropdowns and on the basis of value selected in first dropdown the second dropdown is populated. The first dropdown is Course and on the basis of course selected the second dropdown populates the states where the course is available. Foreg.if the course is 'MCA' the states should be Maharashtra,rajasthan and so-on. For this i have written an ajax function which is working fine. But the problem is i am not able to fetch multiple states at a

How to organize database layer using NHibernate

一世执手 提交于 2020-01-06 14:15:11
问题 To focus on the question here, we can say that I have one database layer and one application layer. So for the application to get access to the database I have to go through the database layer (of course). Now the thing is that I want to write my queries using LINQ. And I could go two different paths here. One way [A] would be to create about 300 individual functions in the DBLayer, and call them from the Application (eg. GetAllUsers() ). OR [B] the DBLayer could more or less just offer a