[nhusers] NHibernate throws exception randomly

2009-12-30 Thread Niclas Pehrsson
My ASP.NET application throws NHibernate exceptions sometimes, when it throw's exceptions it will continue do it a while, so if I'm restarting IIS it will go away and appear later. Here is the log: [IndexOutOfRangeException: Id7_0_] System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String

[nhusers] Versioning question

2009-12-30 Thread Bruno Wouters
Hi all, Is it normal that when I delete an ItemSchedule from the database that the LastUpdateDate of the items gets updated? The Item did not change because I deleted an ItemSchedule right.? ?xml version=1.0 encoding=utf-8 ? hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 class

[nhusers] Once Exception in Sesssion causing subsequent calls failing

2009-12-30 Thread PVM
hi i am trying to update entity with wrong text (passed text length is more than db length) obviously it throws GenericADOExceptionso i changed the text length (less than db field length). when i try to save i got the same error. I checked the profiler to see the generated queryall the

[nhusers] Re: CreateCriteria and loading question

2009-12-30 Thread Zeljko
You could add: .SetFetchMode(TableX, FetchMode.Join) to your Criteria.So you can control when the whole object tree is loaded based on a specific query On 29 pro, 22:57, BZaino bza...@gmail.com wrote: I have a similar issue with my criteria.  I have a Person entity that has a

[nhusers] Same object loaded in collection few times

2009-12-30 Thread marcinmoroz
I have something like this( simpyfing ) ObjectA { DictionaryItem Status; } DictionaryItem { IListDictionaryItemTranslation CurrentTranslations; } DictionaryItemTranslation { string BuisnessObjectName } additionaly CurrentTranslations can be only 0/1 ( has to be maped as a list, cause we

Re: [nhusers] Re: many-to-one cascade=all not deleting

2009-12-30 Thread Fernando Zago
I think deleting by hql doesn't perform cascades. but i'm not so sure. --- Vision without action is a waking dream. Action without vision is a nightmare. On Mon, Dec 28, 2009 at 1:20 PM, Joe jyoung1...@gmail.com wrote: I am using 2.1.0. Upon looking at this further using

Re: [nhusers] Re: many-to-one cascade=all not deleting

2009-12-30 Thread Fernando Zago
Looking at this point, i think u have to create two queries, one deleting the childs where associated with the root entities, and then delete the root entities. (delete from PostContentEntity where id in (select id from PostEntity)) and then (delete from PostEntity) --- Vision without action

[nhusers] Re: Adding mapping file in Configuration Problems

2009-12-30 Thread Mitjast
Tried that, it doesn't work. But in this case it found my assembly and it did not find Some.HBM.xml. I put Some.HBM.xml in the bin folder same folder as .dll. On 28 dec., 18:54, Gautam kalyankrish...@gmail.com wrote: tried this? mapping resource =Some.HBM.xml assembly =Myassembly.dll/ On

[nhusers] Re: CreateCriteria and loading question

2009-12-30 Thread BZaino
Thanks for the tip. However, that did not fix the issue. I added the following line: criteria.SetFetchMode(PersonAddress, FetchMode.Join); When I view the PersonAddress collection within the Person record, I still see the extra fetch in the SQL profilier, and I see 2 PersonAddress records in

[nhusers] Re: Long running multi-stage transactions - handling session state serialization

2009-12-30 Thread Jason Meckley
I think I understand what you are looking for. 1. open connection read data from database 2. make changes to entity 3. rollback database transaction 4. create a save point and store values in memory 5. open connection 6. get entity from database with changes kept in memory 7. make more changes 8.

SV: [nhusers] Once Exception in Sesssion causing subsequent calls failing

2009-12-30 Thread Roger Kratz
When an isession throws, you need discard that session (and rollback tran) and redo your work in a new session. Från: nhusers@googlegroups.com [nhus...@googlegroups.com] f#246;r PVM [pvm...@gmail.com] Skickat: den 30 december 2009 11:07 Till: nhusers

[nhusers] Re: Long running multi-stage transactions - handling session state serialization

2009-12-30 Thread rg
Jason, you got it right. It's not contradicting the idea of UnitOfWork, it's extending it to a transaction consisting of many sub- transactions which can be rolled back or forward at will. In 'the other' ORM it works like a diff feature in version control system - the system remembers changes made

[nhusers] Issue with using ICriteria for sub-object queries

2009-12-30 Thread BZaino
Hi, I have a database with a Person table and a PersonAddress table. The Person table has a many to one relationship with the PersonAddress table, which means that my Person entity has a collection of PersonAddress records in it, amongst other properties. Currently I have 2 records in the

[nhusers] how to debug a leaking connection pool (question)

2009-12-30 Thread Jan Limpens
hello, recently under not yet clearly defined circumstances (it isn't load), we sometimes get into the situation of a non-reacting sql server with the thrown exception: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because

Re: [nhusers] how to debug a leaking connection pool (question)

2009-12-30 Thread jeffrymorris
Sounds like dispose/close is not being called on a session somewhere. I have had the same error when not closing ado.net connections in the past... Sent from my Verizon Wireless BlackBerry -Original Message- From: Jan Limpens jan.limp...@gmail.com Date: Wed, 30 Dec 2009 23:43:42 To:

[nhusers] Re: Issue with using ICriteria for sub-object queries

2009-12-30 Thread marcinmoroz
U don`t use your subCriteria you need to add criteria.Add(Subqueries.Exists(subCriteria)); On 30 Gru, 20:20, BZaino bza...@gmail.com wrote: Hi,    I have a database with a Person table and a PersonAddress table. The Person table has a many to one relationship with the PersonAddress table,