[nhusers] Temporal Database

2009-01-15 Thread Ido Ran
Hello, I've been reading for a while about temporal database and the main thing I understood was: it's hard. I would like to present the way I think of implementing temporal database (or version database) and I'll be happy to hear what you think or how you will go about it. Let's start with the

[nhusers] unique constraints on one-to-many

2009-01-15 Thread Mike Nichols
I have a one-to-many association from Project to ProjectSampleRelationship. ProjectSampleRelatiosnhip is conceptually a ValueObject though in NH it is a entity. Therefore, I want to DELETE and INSERT any updates to a ProjectSampleRelationship in the set/ of SampleRelationships. The unique

[nhusers] Re: Nested transactions

2009-01-15 Thread Luis Abreu
I think that using a TransactionScope object to wrap all your method calls should work in this case. From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Stuart Campbell Sent: quinta-feira, 15 de Janeiro de 2009 10:29 To: nhusers@googlegroups.com Subject: [nhusers]

[nhusers] IsDirty() is true when retrieving objects

2009-01-15 Thread Adeel
Hibernate version: Nhibernate 2.1.0.1001 Mapping documents: property name=hairColorCollectie type=HiDating.BusinessLayer.Mapping.EnumMappingHelper`1 [[HiDating.BusinessLayer.HairColor, HiDating.BusinessLayer]], HiDating.BusinessLayer access=field column=PersonProfile_HairColorID / Code between

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Roger Kratz
Remove the type=[...] in the mapping. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Adeel Sent: den 15 januari 2009 14:56 To: nhusers Subject: [nhusers] IsDirty() is true when retrieving objects Hibernate version: Nhibernate

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Roger Kratz
Ah, sorry - didn't see you had your own IUSertype. Forget my mail. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Adeel Sent: den 15 januari 2009 14:56 To: nhusers Subject: [nhusers] IsDirty() is true when retrieving objects Hibernate

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Adeel
Forgotten... On 15 jan, 14:59, Roger Kratz roger.kr...@teleopti.com wrote: Ah, sorry - didn't see you had your own IUSertype. Forget my mail. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Adeel Sent: den 15 januari 2009 14:56 To:

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Adeel
I checked Equals, and there was a error in there indeed. I changed it and now it is working!!! Thanks a million. On Jan 15, 3:18 pm, Roger Kratz roger.kr...@teleopti.com wrote: I would verify that IuserType.Equals(object, object) is correctly impl. Set a break point there when you flush your

[nhusers] Re: Nested transactions

2009-01-15 Thread Stuart Campbell
To be honest I'm *not* actually sure. I will check that. Thanks Luis. Will also look into Castle Automatic Transaction facility. On Thu, Jan 15, 2009 at 2:31 PM, Luis Abreu lab...@gmail.com wrote: The thing is, I don't really want to have a dependency on MSDTC, which I believe would be the

[nhusers] Re: Nested transactions

2009-01-15 Thread Tuna Toksöz
Check Fabios blog at http://fabiomaulo.blogspot.com Tuna Toksöz http://tunatoksoz.com Typos included to enhance the readers attention! On Thu, Jan 15, 2009 at 12:28 PM, Stuart Campbell stuart.campbe...@gmail.com wrote: What's the recommended way to support nested transactions in NH?

[nhusers] IList and Binding

2009-01-15 Thread Kris-I
Hello, I have a question, it's not, I think, 100%Nibernate I'm doing a project, first one, completely in NHibernate. I have some method, these methods return an IList. That's find. But now, I'd like to bind this IList with some controls like : DataGridView, BindingNavigator,TextBox and

[nhusers] Re: Nested transactions

2009-01-15 Thread Will Shaver
If you are using Rhino-Tools - or would consider using it - there is a lot of work in there for the UnitOfWork pattern. Specifically review the LongConversationManager.cs and the UnitOfWork.cs files. These allow you to have multiple concurrent conversations going for the same user, which can be

[nhusers] dynamic-component and changing mapping at runtime

2009-01-15 Thread Daniel Fernandes
Hello I've got to map an object with a lot of properties that really are better located into a Map. This can be implemented using the dynamic-component. Now my second requirement is that not only I don't know what are the elements that need going into the map at buildtime I don't know either at

[nhusers] ISessionManager.Refresh in 2.0.1 GA issue

2009-01-15 Thread joe
Has anyone run into an issue in NH 2.0.1 GA? I've upgraded recently from 1.2, and have noticed that is the ISessionManager.Refresh() is called for an object already loaded in the session, that a cascade forces loading of all child objects, even if the map specifies that they are lazy. The first

[nhusers] ICriteria-based queries lack optimization on foreign key reference

2009-01-15 Thread Gabriele Tassi
Hello everybody, this is my first post in this group and I wonder if anybody has experienced this same problem. I'm working on a NHibernate-based project and I wanted to play a little with Linq to NHibernate, from NHibernate Contrib. So I happily integrated it in my system and turned some

[nhusers] Re: IList and Binding

2009-01-15 Thread Gustavo Ringel
in winforms new BindingListT(IListT) will create a boundable list. Same thing for ASP.NET as far as i remember but i work mostly winforms. Gustavo. On Thu, Jan 15, 2009 at 6:47 PM, Kris-I kris.i@gmail.com wrote: Hello, I have a question, it's not, I think, 100%Nibernate I'm doing

[nhusers] Re: ICriteria-based queries lack optimization on foreign key reference

2009-01-15 Thread Ayende Rahien
Please post the relevant SQL in both cases. On Thu, Jan 15, 2009 at 12:39 PM, Gabriele Tassi gabriele.ta...@gmail.comwrote: Hello everybody, this is my first post in this group and I wonder if anybody has experienced this same problem. I'm working on a NHibernate-based project and I

[nhusers] Re: ICriteria-based queries lack optimization on foreign key reference

2009-01-15 Thread Gabriele Tassi
Ouch! I fear that I already removed all the Linq to NHibernate stuff, so I cannot provide you the exact query... Anyway, here's more less what I got: First case (Hql) select USER.FIRST_NAME, USER.LAST_NAME, ... USER.ID from USER where USER.SITE_FK = :SiteId Second case

[nhusers] Re: IList and Binding

2009-01-15 Thread Nathan Stott
You don't have to create a BindingListT for asp.net. asp.net is happy to work with IListT On Thu, Jan 15, 2009 at 1:01 PM, Gustavo Ringel gustavo.rin...@gmail.comwrote: in winforms new BindingListT(IListT) will create a boundable list. Same thing for ASP.NET as far as i remember but i work

[nhusers] Re: IList and Binding

2009-01-15 Thread Paulo Quicoli
Hi, you can check here: http://www.codeproject.com/KB/WPF/WPF_NHibernate_Validator.aspx My WPF sample app using NHibernate. I make use of BindingListT(IListT) 2009/1/15, Gustavo Ringel gustavo.rin...@gmail.com: in winforms new BindingListT(IListT) will create a boundable list. Same thing for

[nhusers] Re: ICriteria-based queries lack optimization on foreign key reference

2009-01-15 Thread Ayende Rahien
The contrib linq is not optimized, so that is not surprising.Try to use Criteria directly for that, and we can inspect the results better On Thu, Jan 15, 2009 at 1:40 PM, Gabriele Tassi gabriele.ta...@gmail.comwrote: Ouch! I fear that I already removed all the Linq to NHibernate stuff, so I

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread John Teague
Are you testing business logic that is using your repository, or are you testing the repository itself? On Thu, Jan 15, 2009 at 1:23 PM, Troy T. troyltut...@gmail.com wrote: Hi, I'm using Linq to NH in a project, and would like to test my repository code without hitting the database. I have

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Troy Tuttle
Both actually. I specifically want to test querying logic like this: public Customer FindByCustomerNumber(string customerNumber) { return _repository.FindByCustomer(b = b.CustomerNumber == customerNumber); } Which calls public T FindByT(ExpressionFuncT, bool where) { return

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread isaiah perumalla
In my experience, i found it useful to simply write integration-tests to test the repositories. I generally avoid mocking 3rd party type such as ISession since the interaction tests will most like be quite fragile On Jan 15, 1:22 pm, John Teague jctea...@gmail.com wrote: Are you testing

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Troy Tuttle
That's what we are currently doing now, but as the domain model grows, the integration tests can get huge when testing queries with multiple criteria (like a search screen). I'm finding most of the work is in getting the database in the correct state for these kinds of respository/integration

[nhusers] NHibernate.Linq Alpha Released

2009-01-15 Thread Chad Lee
NHibernate.Linq is a Linq provider for NHibernate 2.0.1 GA. It processes Linq expressions using NHibernate's Criteria API. This release is meant as a stopgap release pending an implementation not reliant on the Criteria API. Most queries are supported with the exception of the following: -

SV: [nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Roger Kratz
It's a lot easier to create an in-memory list of customers to query against than setup records in the db. Why? Maybe I'm missing something but... inMemList.Add() vs repository.Add() is pretty similar? Från: nhusers@googlegroups.com [nhus...@googlegroups.com]

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Stefan Sedich
My 2 cents if that counts :) Personally I have gone down this route before with testing repositories, but in the end found that mocking session calls just becomes WAY too hard. I guess you ask yourself what value do you get from mocking your queries against the session? IMO this is very little

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread isaiah perumalla
did you try out nDBUnit to get the db in a good state for tests ? On Jan 15, 2:29 pm, Troy Tuttle troyltut...@gmail.com wrote: That's what we are currently doing now, but as the domain model grows, the integration tests can get huge when testing queries with multiple criteria (like a search

[nhusers] Re: NHibernate.Linq Alpha Released

2009-01-15 Thread reach4thelasers
Hi Chad, do you know if its possible to get this to work with the NH trunk? or is it impossible? I tried compiling a version against it last week but I had a lot of bother getting things to work. Is there any strict technical reason why it shouldn't work? thanks, Kev On Jan 15, 9:53 pm,

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Troy Tuttle
Yes, by itself it is very similar. But when we get to a full suite of integration tests, I have to manage cleanup so the db is in a good state before the next test runs. But an in-memory collection will be cleaned up for me automatically by the garbage collector (or at least I don't have to

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Stefan Sedich
How is this testing your queries though? How is an in memory collection going to mimic your relational DB and validate your mapping files are correct? Cascades work etc etc. I still think NDBUnit is the way to go when testing your repository layer. Cheers Stefan On Fri, Jan 16, 2009 at 10:31

[nhusers] How to handle constraint violations in session per request pattern?

2009-01-15 Thread che
In session per request pattern, session is flushed and transaction committed at the end of the request? How do I handle unique or check constraint violations during the request? In my old applications, I would simply catch constraint violation exceptions and then show appropriate error message