[nhusers] Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Dawid
Hi, I've written some code to use Unity as a DI container inside NHibernate and all seemed to be well. Today I tried to change a one-to-many mapping to a composite-element inside a bag and I now get an exception in NHibernate.Tuple.PocoInstantiator.Instantiate stating that the entity has no

[nhusers] Re: Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Fabio Maulo
where you have shared your code about the reflection optimizer using Unity ? 2009/8/23 Dawid dmost...@gmail.com Hi, I've written some code to use Unity as a DI container inside NHibernate and all seemed to be well. Today I tried to change a one-to-many mapping to a composite-element

[nhusers] Re: Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Fabio Maulo
2009/8/23 Dawid dmost...@gmail.com Is the the expected behavior, or is there something that should do differently? The second. -- Fabio Maulo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] Re: Can I disable automatic updating of dirty objects?

2009-08-24 Thread Oskar Berggren
2009/8/22 kurtharriger kurtharri...@gmail.com: I also would like to go on the record as saying that I too believe dirty checking is a a bad idea and probably should be considered a bug because it violates encapsulation boundaries. I disagree with your terminology. I consider a bug to be a

[nhusers] Re: Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Dawid
I haven't shared it yet, but it is based on bits and pieces of code blog posts that I've put together. Where and or how can I share? On Aug 24, 8:05 am, Fabio Maulo fabioma...@gmail.com wrote: where you have shared your code about the reflection optimizer using Unity ? 2009/8/23 Dawid

[nhusers] Re: Can I disable automatic updating of dirty objects?

2009-08-24 Thread Stefan Steinegger
I try to explain it again. Don't rely on the fact that there is a database. Validation should not occur before changes are persisted, but when they are done (in memory, by the business logic). Making changes in memory but not storing them is NOT the solution. How would to reliably validate

[nhusers] Re: Nested Sessions/Transactions Possible ?

2009-08-24 Thread ReverseBlade
So no suggestions ? On Aug 21, 8:29 pm, Fabio Maulo fabioma...@gmail.com wrote: ah... and that is the reason because I'm injecting the ISessionFactory on my DAOs/Repository 2009/8/21 Fabio Maulo fabioma...@gmail.com session = UoWstatelesssession != UoW 2009/8/21 empe...@gmail.com

[nhusers] Re: AfterTransactionBegin in events

2009-08-24 Thread Niclas Pehrsson
It would be nice, well I guess I will go for the then interceptor. keep up the good work :) On 21 Aug, 19:28, Fabio Maulo fabioma...@gmail.com wrote: I don't remember... perhaps we should add it and some others as: OnSessionOpen OnSessionClose 2009/8/21 Niclas Pehrsson pehrs...@gmail.com

[nhusers] Re: Nested Sessions/Transactions Possible ?

2009-08-24 Thread Stefan Steinegger
@Fabio, sorry, but sometimes I just don't have a clue what you are talking about :-) We are loading entities using select new or AliasToBeanResultTransformer to get instances of entities from a normal session without performance problems. You can create a child session using session.GetSession.

[nhusers] Re: OnPreInsert inconsistent behaviour

2009-08-24 Thread Chris F
Anyone able to take a second look at this issue and give me any direction? Much appreciated, - Chris On Aug 21, 4:09 pm, Chris F mcfaz...@gmail.com wrote: It's not even limited to my joined subclasses it seems... This is all becoming rather non-deterministic. I have a base class called

[nhusers] Re: Can I disable automatic updating of dirty objects?

2009-08-24 Thread Fabio Maulo
I don't understand if you are joking or what. You can disable autodirty check by configuration. http://fabiomaulo.blogspot.com/2009/03/ensuring-updates-on-flush.html http://fabiomaulo.blogspot.com/2009/03/ensuring-updates-on-flush.html Using similar events of NHV

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread Seth Goldstein
The code is essentially: class ParentClass { private int _myProperty; ParentClass() { } public virtual int MyProperty() { get; set; } } class ChildClass : ParentClass { ChildClass() { int myPropertyValue = base.MyProperty() } } With mapping files similar to:

[nhusers] Re: Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Fabio Maulo
Here, in a blog post in your blog, in your home page in www.nhforge.org, in a wiki in www.nhforge.org 2009/8/24 Dawid dmost...@gmail.com I haven't shared it yet, but it is based on bits and pieces of code blog posts that I've put together. Where and or how can I share? On Aug 24, 8:05

[nhusers] Re: AfterTransactionBegin in events

2009-08-24 Thread Fabio Maulo
2009/8/24 Niclas Pehrsson pehrs...@gmail.com It would be nice, well I guess I will go for the then interceptor. keep up the good work :) Perhaps you can even create a new feature request if you are sure that we haven't that events. Note: In a new feature request what is useful is explain

[nhusers] How to get Lazy object without CTypeProxy... in the class name?

2009-08-24 Thread Guga Oliveira
I am getting some problems when we get a list of objects from a lazy initialization, some times the object is not recognized as the main class of the object. We have debugged and the list return a CTypeProxy or something like that instead of the Class of the object. This is turning us with some

[nhusers] ICriteria Join Condition

2009-08-24 Thread Craig van Nieuwkerk
I am trying to use ICriteria to create a query that has a join condition. The SQL I am trying to generate should look like this SELECT c.ClientID FROM Client c LEFT OUTER JOIN ClientContact t on c.ClientID = t.ClientID AND t.ContactType = 'Email' If I use a criteria like

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread Stefan Steinegger
How does the line of code exactly look like, where the null reference exception occurs? And where is this line of code? On 24 Aug., 16:03, Seth Goldstein seth.d.goldst...@gmail.com wrote: The code is essentially: class ParentClass {   private int _myProperty;   ParentClass()   {   }  

[nhusers] NHibernate.Linq

2009-08-24 Thread spiralni
Good morning.. I have an application using .net2.0 and yesterday I started the migration to 3.5 framework (using nhibernate 2.1) , this is why I am interested in NHib.Linq, to see if I can make use of it. My request is Is NHibernate.Linq ready for production environments? Where Do I find

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread Seth Goldstein
Sorry about the confusion. It is not an autoproperty. I was just trying to keep my sample code small. It is a full fledged property with a getter setter. On Aug 24, 9:39 am, José Romaniello jfromanie...@gmail.com wrote: MyProperty on ParentClass is an autoproperty? 2009/8/24 Seth

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread José Romaniello
MyProperty on ParentClass is an autoproperty? 2009/8/24 Seth Goldstein seth.d.goldst...@gmail.com field.camelcase-underscore --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers group. To post to this group,

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread Seth Goldstein
The null reference exception is on this line: // oops, this should have been this instead of base, don't think it matters // int myPropertyValue = this.MyProperty() In the constructor, this is actually a proxy to ChildClass and not an actual instance of ChildClass. And when I try to reference

[nhusers] Re: Calling parent properties from inherited constructors

2009-08-24 Thread Fabio Maulo
2009/8/24 Stefan Steinegger stefan.steineg...@bluewin.ch How does the line of code exactly look like, where the null reference exception occurs? And where is this line of code? to not say... please send real code or, at least, valid code. (the code above does not compile) -- Fabio Maulo

[nhusers] Re: issue with inverse=true

2009-08-24 Thread graphicsxp
Hi, Thanks for helping. The mapping for the Art class : ?xml version=1.0 encoding=utf-8 ? hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 class name=XXX.Art, XXX table=Art id name=Id column=BuzzUserArtID type=guid generator class=guid.comb/ /id many-to-one name=Owner

[nhusers] Re: How to handle Session in WinForm project?

2009-08-24 Thread ChrisHolmes
Wojciech, Thank you sir. This is incredibly helpful. I had no idea this capability for contextual sessions existed in NHibernate. I believe this is going to help me tremendously. Awesome post Wojciech. -Chris On Aug 23, 7:23 pm, Wojciech Wieronski wojciech.wieron...@gmail.com wrote: Chris I

[nhusers] Re: Problem using Unity as a reflection optimizer and changing a one-to-many to a composite-element mappings

2009-08-24 Thread Fabio Maulo
Have a look here http://fabiomaulo.blogspot.com/2009/05/nhibernate-ioc-integration.html http://fabiomaulo.blogspot.com/2009/05/nhibernate-ioc-integration.htmlYou can see that there are solutions for Castle and Spring.NET. If you have a look to comments you can find the solution for AutoFac. The

[nhusers] Re: How to handle Session in WinForm project?

2009-08-24 Thread Fabio Maulo
2009/8/24 ChrisHolmes cb.hol...@gmail.com This is incredibly helpful. I had no idea this capability for contextual sessions existed in NHibernate. And this mean you haven't read all previous mails and links. -- Fabio Maulo --~--~-~--~~~---~--~~ You

[nhusers] Re: How to get Lazy object without CTypeProxy... in the class name?

2009-08-24 Thread Fabio Maulo
2009/8/24 Guga Oliveira gugaolive...@gmail.com I am getting some problems when we get a list of objects from a lazy initialization, some times the object is not recognized as the main class of the object. We have debugged and the list return a CTypeProxy or something like that instead of the

[nhusers] Re: How to handle Session in WinForm project?

2009-08-24 Thread Stefan Nobis
Jim Tanner dobr...@gmail.com writes: @Every one who might be interrested : This article deals with a way to handle lazy loading in winforms. http://www.codeproject.com/KB/cs/NHibernateLazyInitializer.aspx I don't think this is a good idea, because it may lead to quite bad performance. A much

[nhusers] NHibernate proxy class not lazy loading itself?

2009-08-24 Thread James Crowley
I'm seeing a strange issue whereby accessing a lazy-loaded property I only get the Proxy object that has clearly *not* lazy loaded - it has all its properties null, and just it's ID set. The row definitely exists in the table. Another lazy loaded property (that references an entity already in

[nhusers] Re: How to handle Session in WinForm project?

2009-08-24 Thread ChrisHolmes
And how exactly is that attitude helping me? Everyone has been pretty kind here - except you. -Chris On Aug 24, 8:55 am, Fabio Maulo fabioma...@gmail.com wrote: 2009/8/24 ChrisHolmes cb.hol...@gmail.com  This is incredibly helpful. I had no idea this capability for contextual sessions

[nhusers] Re: How to handle Session in WinForm project?

2009-08-24 Thread José Romaniello
The attitude that will help you is the* reader attitude*. No one has enough time to write something twice. You should be reading the former links and then answer concrete questions. You say that you don't have enough time to execute the samples and configure it. But you have enough time to

[nhusers] Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Hello, I am using the observable collections implementation from the following post to handle collections within a WPF application. http://happynomad121.blogspot.com/2007/12/collections-for-wpf-and-nhibernate.html I am currently adding .CollectionTypeObservableSetTypeT() to each property

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Fabio Maulo
The proposal of CollectionTypeFactoryClass is allow the substitutions of all persistent collections by default.If you want see an implementation using observable collections it is available here: http://code.google.com/p/unhaddins/source/browse/#svn/trunk/uNhAddIns/uNhAddIns.WPF/Collections

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
That is exactly what I needed! I really appreciate all your great work... Chris On Aug 24, 3:02 pm, Fabio Maulo fabioma...@gmail.com wrote: The proposal of CollectionTypeFactoryClass is allow the substitutions of all persistent collections by default.If you want see an implementation using

[nhusers] Re: Burrow compiled against NHibernate 2.1.0

2009-08-24 Thread Ricardo Peres
Read this post and see if it applies: http://weblogs.asp.net/ricardoperes/archive/2009/08/20/using-nhibernate-validator-1-0-with-nhibernate-2-1.aspx On Aug 11, 5:54 pm, Tomasz Modelski (IDev) modelski.tom...@gmail.com wrote: Hi. Where can I find Burrow compiled with latest NHibernate 2.1.0

[nhusers] Re: Kind of a novice question (Session.Save, Session.Flush, Transaction.Commit)

2009-08-24 Thread Andrey Shchekin (ashmind)
I haven't changed it, so it is the default mode in 2.1. Without transaction it is not auto-flushed, with transaction it is auto-flushed, but only for changes to existing entity. (Sorry for the long delay, the question was approved when I already was on a vacation). On Aug 11, 10:58 pm, Davy

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread José Romaniello
There is also an ObservableSet. I use this class as a transient observable set since .net framework only have an observable list. In order to configure the collection type factory I use: configuration.Properties[Environment.CollectionTypeFactoryClass] = typeof

[nhusers] Re: Unzippable copy of NHibernate 2.1

2009-08-24 Thread marcal
I didn't see any notes to this effect on the downloads page. This is a critically visible problem that is probably turning new users and other OSS toe-dippers off of NH, or at least off of 2.1 GA, especially if there isn't a reason included directly on the downloads page. Perhaps add a

[nhusers] Querying across relationships with NHibernate.Linq

2009-08-24 Thread Nick Aceves
We've recently upgraded one of our projects to NH 2.1, and would like to use NHibernate.Linq for as much of our querying as possible. We have several queries of the following form: session.CreateCriteria(typeof(Parent)) .CreateCriteria(Children) .Add(Restrictions.Eq(PropertyOfChild,

[nhusers] Recovering a new session from thrown exception

2009-08-24 Thread ColinM
Hi As part of an application that I am developing I have encountered an issue with the ISession object that I just can't resolve. The basic issue occurs when I attempt to write an audit entry after some some database processing throws an exception. I understand that when an exception is thrown

[nhusers] Spatial Projections.

2009-08-24 Thread oharab
I'm hoping there's at least one other Spatial user in here! I'm trying to use the Intersection SpatialAnalysisProjection but the only option available, as far as I can see, is to perform an intersection against an existing property, whereas I want to return the intersection between my geometry

[nhusers] Documentation Version

2009-08-24 Thread Manuel Wenk
Hi there, I'm trying to evaluate NHibernate 2.1.0. Unfortunatley I'm not able to find the right Documentaion Version. The Sourceforge NHibernate-2.1.0.GA-reference.zip File only contains Infos about V 1.0.2, same with the Online Version: http://nhforge.org/doc/nh/en/index.html#quickstart What

[nhusers] Re: Unzippable copy of NHibernate 2.1

2009-08-24 Thread Fabio Maulo
good idea 2009/8/24 marcal mlewa...@rochester.rr.com I didn't see any notes to this effect on the downloads page. This is a critically visible problem that is probably turning new users and other OSS toe-dippers off of NH, or at least off of 2.1 GA, especially if there isn't a reason

[nhusers] Re: Documentation Version

2009-08-24 Thread Fabio Maulo
nothing wrong... but if you try to go a little bit forward you can use that reference. 2009/8/24 Manuel Wenk argb...@googlemail.com Hi there, I'm trying to evaluate NHibernate 2.1.0. Unfortunatley I'm not able to find the right Documentaion Version. The Sourceforge

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Hi José, I am attempting to try out your ObservableSet implementation but am having a couple of issues. First off I can't seem to get the global registration working using the code you supplied below. I seems to be ignoring the configuration property change and using the default

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Sorry, the ConfigureCollectionType method I was trying is actually as follows: private void ConfigureCollectionType(Configuration configuration) { configuration.SetProperty (Cfg.Environment.CollectionTypeFactoryClass, typeof

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Below is my base entity class. I have a class (GuidPOCO) that inherits from BindableObject and just implements an Id property as a guid along with some vaidation logic. /// summary /// Implements the INotifyPropertyChanged interface and /// exposes a NotifyPropertyChanged method

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread José Romaniello
Sorry, I want to see the property where you need to put the observableset. And the code that you are using to remove an item from that collection. 2009/8/24 Chris Willard chris.will...@rimrockgroup.com Below is my base entity class. I have a class (GuidPOCO) that inherits from

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Oh yeah, sorry. I am calling this extension method to remove the item: public static void RemoveRangeT(this ICollectionT collection, IEnumerableT items) { if (items != null) { foreach (var item in items) {

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Fabio Maulo
too much boiled code. 2009/8/24 Chris Willard chris.will...@rimrockgroup.com Oh yeah, sorry. I am calling this extension method to remove the item: public static void RemoveRangeT(this ICollectionT collection, IEnumerableT items) { if (items != null)

[nhusers] Re: Querying across relationships with NHibernate.Linq

2009-08-24 Thread Chris Nicola
What sql is it generating for you? I ran a similar query on my own project to compare and it resulted it a single select statment: var query = from entry in Session.LinqEntry() where entry.EntrySplits.Any(x = x.Amount 100) select entry;

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Yeah, I was thinking he wanted to see the entire entity for some reason... On Aug 24, 10:06 pm, Fabio Maulo fabioma...@gmail.com wrote: too much boiled code. 2009/8/24 Chris Willard chris.will...@rimrockgroup.com Oh yeah, sorry.  I am calling this extension method to remove the item:

[nhusers] optimize lucene index and still allow searches

2009-08-24 Thread chris ortman
Has anyone figured out how to optimize the lucene index and still allow searches to be successful? All the doc I have read it seems like this is supposed to work, but it does not you wind up getting errors like: Unhandled Exception: System.ServiceModel.FaultException`1

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Chris Willard
Those interfaces are implemented in my entity base class (BindableObject) from which GuidPOCO is derived (Section GuidPOCO BindableObject). I am not familiar with the term boiled code, so I am not sure how to respond. Please let me know if you need any additional info or if I am

[nhusers] Re: Set .CollectionTypeT globally with Fluent

2009-08-24 Thread Fabio Maulo
what I mean is that you can do the same without that boiled code. 2009/8/25 Chris Willard chris.will...@rimrockgroup.com Those interfaces are implemented in my entity base class (BindableObject) from which GuidPOCO is derived (Section GuidPOCO BindableObject). I am not familiar with the