Questions tagged [nhibernate-3]

Use this tag for Nhibernate version 3.x series specific question.

NHibernate is a mature, open source object-relational mapper (ORM) for the .NET framework. This tag refers to the 3.x series of this project.

86 questions
0
votes
1 answer

Reason for MappingException: No persister for: MyClassProxy

In a SaveOrUpdate call I'm getting the MappingException No persister for: MyClassProxy. What's strange is that I am able to insert new rows with the code, but if that row exists and the repository tries to update it, I'm getting this…
Philipp M
  • 1,877
  • 7
  • 27
  • 38
0
votes
1 answer

Add list item by ID

Let's say: public class Parent { public virtual IList Childs { get; set; } public void AddChild(long childId) { // Link existing child to parent. } } I'm trying to implement DDD using NHibernate so I wonder how to…
Sergey Metlov
  • 25,747
  • 28
  • 93
  • 153
0
votes
1 answer

A different object with the same identifier value was already associated with the session: XXX, of entity

We have a ASP.NET MVC 3 C# project running NHibernate 3 and Castle.ActiveRecord for MySQL, and we trying to get "one session per request" to work with this tutorial. And it seems to work for some stuff, but when we do SaveAndFlush(), the command…
RickardP
  • 2,558
  • 7
  • 34
  • 42
0
votes
1 answer

Read unknown additional fields with NHibernate

I have a table, which is mapped with NHibernate: Person ------ Firstname Lastname There is also a DTO which is called Person. Now, there are possibilities, that there are more fields, than known at design-time. The user can add customer defined…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
0
votes
1 answer

Connection pooling using custom connection provider

Is connection pooling enabled when you use a custom connection provider that generates connection strings dynamically? The user is the only data changed in the connection string, and many sessions can be opened for the same user through the time. By…
0
votes
1 answer

NHibernate Removing ManyToMany record when deleting parent

i'm working with legacy code(so i'd like to change it as little as possible), and i'm having a little trouble with a many to many relationship here. Here's what i have: public class Feature { List Profiles{get;set;} } public class…
Tejo
  • 1,268
  • 11
  • 18
0
votes
2 answers

Misplaced call `OnPreUpdate` in Auditor Event listener implementation in NHibernate

I have a project by using NHibernate 3. I used Auditor Event Listener in NHibernate for Trim of string properties in my entities. My code is : public class AuditorEventListener : IPreInsertEventListener, IPreUpdateEventListener { public bool…
Ehsan
  • 3,431
  • 8
  • 50
  • 70
0
votes
1 answer

NHibernate tries to flush operation that already failed - how to aviod it

In my web application, somewhere during request cycle I call following method on repository: repository.Delete(objectToDelete); and this is NHibernate implementation: public void Delete(T entity) { if…
dragonfly
  • 17,407
  • 30
  • 110
  • 219
0
votes
1 answer

State change instead of real delete

Is it possible to overload Session.Delete() behavior to not to perform real deleting from DB but update value of int State column to special deleted value? And would be great to restrict then loading of deleted entities by GetAll() method.
Sergey Metlov
  • 25,747
  • 28
  • 93
  • 153
0
votes
1 answer

OutOfMemory Exception while fetching large sized data using QueryOver<> in Linq to Nhibernate

I have a asp.net web application that is using Linq to NHibernate in NHibernate 3.0. In a function, I need to get around 20000 records from a table which contains 10 million records with 20 columns. I am using Session.QueryOver<>() method for…
Rupendra
  • 608
  • 2
  • 11
  • 42
-2
votes
2 answers

Object A has a collection of object B. In NHibernate using LINQ, how to retrieve a list of A having at least one B

Let's take as example these domain objects: public class A { public Guid Id { get; set; } public ICollection CollectionOfB { get; set; } } public class B { public Guid Id { get; set; } public string Name { get; set; } } I need…
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
1 2 3 4 5
6