[nhusers] Unique Constraint Error

2010-09-16 Thread Sujith
Hi, I am getting errors when updating fields which has a unique key constraint. Actually, the collection is having the changed values and there is no duplication in the unique key fields. My records are as below Initially, A B -- -- 1 1 1 2 2

[nhusers] Re: linq subquery

2010-09-16 Thread Sujith
I think you require a link between customers and orders On Sep 16, 6:43 am, Aaron Fischer pretzelfi...@gmail.com wrote: Is this possible with the current nhibernate 3 linq provider var temp = from c in customers                    from o in c.Orders                    where                  

Re: [nhusers] Re: linq subquery

2010-09-16 Thread Mohamed Meligy
There is a link already. He got orders from customer (from o in *c*.Orders, *c* is got by from *c* in customers). I don't think you can, but give it a try anyway. IF it doesn't work maybe you can do it the other way around. Query on orders and then select o.Customer. *Mohamed Meligy

Re: [nhusers] Re: Using varchar insted of nvrachar for parameters

2010-09-16 Thread Armin Landscheidt
What I need is a default mapping from System.String to AnsiString. So I could use both if I want. In the SqlDriver I can replace string with ansistring but if I do so I can't use string anymore. 2010/9/16 Fabio Maulo fabioma...@gmail.com Driver and Dialect are dbspecific -- Fabio Maulo El

[nhusers] Generator for non identity column

2010-09-16 Thread Yauhen
Is there any way to use generator for non id column? So for example I have 2 columns: [IdentityColumn] [int] IDENTITY(1,1) NOT NULL, [EventId] [int] NOT NULL, first is primary key, second should be auto incremented (generator class=increment/). And most desired it should be done in single

[nhusers] Re: Could not find a matching criteria info provider

2010-09-16 Thread void*
This is now a JIRA issue: NH-2331 And an additional info: It does NOT work in 3.0.0 Alpha2 as well. -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to nhus...@googlegroups.com. To unsubscribe from this group, send

[nhusers] NHibernate 3 Fetching

2010-09-16 Thread nvollmar
Hi I was playing around with NHibernate 3 and was wondering how one could fetch several levels with Linq to NHibernate and QueryOver. Like Customer.Orders.OrderLines Kind Regards -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this

[nhusers] Using Nhibernate with asp.net

2010-09-16 Thread DavidOs
Hi, Thanks for this group ! I 'm new in Nhibernate and I want to ask about asp.net. I found few articles about it, not much, and they are talking about the need to use Http module events to create ISession for each request. I don't understand why I need to do it, I created a web application and

[nhusers] StaleObjectStateException: Row was updated or deleted by another transaction

2010-09-16 Thread harshil
hi , i got one error while saving an entity, ERROR NHibernate.Event.Default.AbstractFlushingEventListener - Could not synchronize database state with session NHibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) please

Re: [nhusers] Using Nhibernate with asp.net

2010-09-16 Thread Oskar Berggren
The event handlers are just a mechanism. The underlying idea is that: a) all applications need to decide on a strategy for handling the NHibernate session (and transactions). b for many applications it makes sense to divide the work into units of work. c) for web applications there is in most

[nhusers] Re: Adding dynamic restrictions to join clause

2010-09-16 Thread Jason Meckley
Oh sorry, misunderstood the problem. that's a good question, I'm not sure if/how that's possible. On Sep 15, 5:53 pm, Armin Landscheidt saij...@googlemail.com wrote: em yes this is the reason why I want use the Criteria api ;-). The question is not how to use the api, it's how to add conditions

Re: [nhusers] Re: Adding dynamic restrictions to join clause

2010-09-16 Thread harshil hameed
firiends.., pls help us on it,. If 'Criteria' api not support this,we will go with HQL. but like to go with 'Criteria' api always,,(nt hql ;( ) On Thu, Sep 16, 2010 at 5:35 PM, Jason Meckley jasonmeck...@gmail.comwrote: Oh sorry, misunderstood the problem. that's a good question, I'm not

Re: [nhusers] NHibernate 3 Fetching

2010-09-16 Thread Richard Brown (gmail)
http://groups.google.com/group/nhusers/browse_thread/thread/4f15b64ba56c7e20/9ce84cd2f56f274d -- From: nvollmar nvoll...@gmail.com Sent: Thursday, September 16, 2010 11:20 AM To: nhusers nhusers@googlegroups.com Subject: [nhusers] NHibernate 3

[nhusers] Re: Using Nhibernate with asp.net

2010-09-16 Thread DavidOs
Thanks Oskar for your reply. You've made your point. David On Sep 16, 1:49 pm, Oskar Berggren oskar.bergg...@gmail.com wrote: The event handlers are just a mechanism. The underlying idea is that: a) all applications need to decide on a strategy for handling the NHibernate session (and

[nhusers] MVC connection pool timeout

2010-09-16 Thread Luka
Hi, is there a way to see all open nhibernate session in the application? Why? Because, I am getting this error in my MVC application: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and

[nhusers] Re: How to debug a PropertyAccessException

2010-09-16 Thread Lorenzo Vegetti
It was one of the enums, If I have a little time I'll investigate which of them was causing the problem (I suspect the one with the FlagsAttribute) and eventually how to map it correctly. Thanks Jason for pointing me in the right direction! On 15 Set, 17:01, Lorenzo Vegetti l.vege...@libero.it

[nhusers] HQL join

2010-09-16 Thread alexey_baranov
Hello! We try to use HQL first time and found exception. What does this Path expected for join! means ? Path is a string not null property. Wwe try to use this HQL to find Persons within Department rootDepartment and not in subdepartments. Path expected for join! [ select p

[nhusers] Re: HQL join

2010-09-16 Thread Jason Meckley
you'll need to provide the mappings as well. the first problem I see is you are writing hql the same way you would sql, which is not the case. On Sep 16, 12:08 pm, alexey_baranov barano...@inbox.ru wrote: Hello! We try to use HQL first time and found exception. What does this Path expected

[nhusers] Re: How to debug a PropertyAccessException

2010-09-16 Thread Jason Meckley
you're welcome. On Sep 16, 11:43 am, Lorenzo Vegetti l.vege...@libero.it wrote: It was one of the enums, If I have a little time I'll investigate which of them was causing the problem (I suspect the one with the FlagsAttribute) and eventually how to map it correctly. Thanks Jason for pointing

Re: [nhusers] Re: How to debug a PropertyAccessException

2010-09-16 Thread Fabio Maulo
You have to map that enum using int instead string... perhaps. On Thu, Sep 16, 2010 at 12:43 PM, Lorenzo Vegetti l.vege...@libero.itwrote: It was one of the enums, If I have a little time I'll investigate which of them was causing the problem (I suspect the one with the FlagsAttribute) and

[nhusers] Re: MVC connection pool timeout

2010-09-16 Thread Luka
ok, but how? my sessions are managed by structuremap like this: ForISessionFactory().Singleton().Use(cfg.BuildSessionFactory()); ForISession().HttpContextScoped().Use(ctx = ctx.GetInstanceISessionFactory().OpenSession()); and in global.asax. Application_EndRequest I do:

Re: [nhusers] HQL join

2010-09-16 Thread Fabio Maulo
mmm the path mentioned in the exception message is not your property called Path but: left join Department === from where come Department ? it is a property of what ? The other error you will find is on; on is not HQL The other strange thing is: :rootDepartmentPath2 + '%' ; why don't do it in the

[nhusers] Re: How to debug a PropertyAccessException

2010-09-16 Thread Jason Meckley
if NH doesn't map this automagically, then you can implement IUserType for flagged enums. On Sep 16, 12:46 pm, Fabio Maulo fabioma...@gmail.com wrote: You have to map that enum using int instead string... perhaps. On Thu, Sep 16, 2010 at 12:43 PM, Lorenzo Vegetti l.vege...@libero.itwrote:

[nhusers] Re: MVC connection pool timeout

2010-09-16 Thread Luka
And this only happens on IIS 7, when i run the application on my machine (asp.net developer server) all working fine. there is only one connection to the db and when i exit the application the connection to the sql server is closed On Sep 16, 7:11 pm, Luka cluk...@gmail.com wrote: ok, but how?

[nhusers] Re: MVC connection pool timeout

2010-09-16 Thread Jason Meckley
I haven't used SM, but it appears to be OK. I prefer to manage sessions explicitly, rather than have the container scope my session. this may be a byproduct of using Windsor. I have read that SM has excellent logging. you could enable that and trace the session scopes. NHProf will also notify

[nhusers] Re: linq subquery

2010-09-16 Thread Aaron Fischer
That seems to work the query I am having issues with is a little more complex var leads = from folder in _Session.QueryLoanFolder() from loan in folder.LoanFiles from brw in loan.Application.Borrowers select brw.ContactDetails; with this query I am getting a the following error:

[nhusers] Re: linq subquery

2010-09-16 Thread Aaron Fischer
That seems to work the query I am having issues with is a little more complex. var leads = from folder in _Session.QueryLoanFolder() from loan in folder.LoanFiles from brw in loan.Application.Borrowers select

[nhusers] Linq to NH, Large trees

2010-09-16 Thread Scott
I'm new to Linq and one thing I'm not understanding is how to form queries based on nhibernate objects that have collections and I need to get down the tree on them. Obj1.Bags.AnyObjInBag.MoreBags.AnyObjInBag Maybe I'm doing it completely wrong but the only thing that some what works on NH

Re: [nhusers] Re: Using varchar insted of nvrachar for parameters

2010-09-16 Thread Diego Mijelshon
The default is the opposite and you can't change it on the compiled version. But since NH is open source, you can modify lines 197 and 198 in src/NHibernateType/TypeFactory.cs to use AnsiString instead of String. Or you can leave it as-is and pay a third-world contractor 50 bucks to change your

[nhusers] Nhibernate.Linq 1.1.0.1001 has less methods implemented than 1.0.0.4000

2010-09-16 Thread fedehf
Hi. I've just upgraded from NH.Linq 1.0.0.4000 to NH.Linq 1.1.0.1001 so I could use Nhibernate 2.1.2.4000. When I ran my tests I encounter the problem that some methods weren't implemented in the newer version of linq. For example Intersect. Does anybody know how is this possible? Can I download

Re: [nhusers] Re: Using varchar insted of nvrachar for parameters

2010-09-16 Thread armin-landscheidt
I think I will evaluate the two possibillities. 1. Override the GernerateCommand methode in the SqlDriver and change String to AnsiString. But I don't know if this could become a big problem. 2. While adding the mappings set the Type to Ansistring if no Type ist set. At the moment I'm

[nhusers] Super-type to Subtype

2010-09-16 Thread Matt Mangold
In my application, I have an object hierarchy of Person-Employee- Administrator. I want to be able to take an existing employee and make them an administrator. I know that in OO world, this is not possible, you must first destroy the employee object create a new Administrator object and build

[nhusers] ADO.NET Batching Causes SQL Exception Converter to be Skipped

2010-09-16 Thread Colin Bowern
Just noticing a new behavior - when I enable batching by settings the adonet.batch_size, NH throws the raw exception from the ADO.NET driver (in my case an OracleException from ODP.NET). It doesn't run it through the ISQLExceptionConverter class wired in as I would expect. If I disable batching

Re: [nhusers] Super-type to Subtype

2010-09-16 Thread José F . Romaniello
2010/9/16 Matt Mangold matt.mang...@equusoft.com I want to be able to take an existing employee and make them an administrator. Then your model is not properly mapped. The idea of changing the discriminator value, it doesn't make any sense if you think twice. If you can change the

Re: [nhusers] Super-type to Subtype

2010-09-16 Thread Diego Mijelshon
Your object model is not correct. The correct relationship is not An Administrator is an Employee but An Employe has the Administrator role. Diego On Thu, Sep 16, 2010 at 19:22, Matt Mangold matt.mang...@equusoft.comwrote: In my application, I have an object hierarchy of Person-Employee-

Re: [nhusers] Re: How to debug a PropertyAccessException

2010-09-16 Thread Fabio Maulo
On Thu, Sep 16, 2010 at 2:19 PM, Jason Meckley jasonmeck...@gmail.comwrote: if NH doesn't map this automagically, then you can implement IUserType for flagged enums. You don't need to implements a IUserType for flagged enum. -- Fabio Maulo -- You received this message because you are

Re: [nhusers] ADO.NET Batching Causes SQL Exception Converter to be Skipped

2010-09-16 Thread Fabio Maulo
It is a bug inside the OracleBatchingBatcher On Thu, Sep 16, 2010 at 7:28 PM, Colin Bowern co...@bowern.com wrote: Just noticing a new behavior - when I enable batching by settings the adonet.batch_size, NH throws the raw exception from the ADO.NET driver (in my case an OracleException from

Re: [nhusers] Super-type to Subtype

2010-09-16 Thread José F . Romaniello
indeed! I said something wrong, it is not a mapping problem, it is a problem in the domain model. I agree 100% with Diego. 2010/9/16 Diego Mijelshon di...@mijelshon.com.ar Your object model is not correct. The correct relationship is not An Administrator is an Employee but An Employe has the

Re: [nhusers] Re: Adding dynamic restrictions to join clause

2010-09-16 Thread Fabio Maulo
NHibernate has 6 ways to query your domain btw ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType, ICriterion withClause); On Thu, Sep 16, 2010 at 9:22 AM, harshil hameed harshi...@gmail.com wrote: firiends.., pls help us on it,. If 'Criteria' api not support

Re: [nhusers] Generator for non identity column

2010-09-16 Thread Fabio Maulo
property generated=insert/ column blah blah sql-type=/ On Thu, Sep 16, 2010 at 5:48 AM, Yauhen yauhe...@gmail.com wrote: Is there any way to use generator for non id column? So for example I have 2 columns: [IdentityColumn] [int] IDENTITY(1,1) NOT NULL, [EventId] [int] NOT NULL, first

Re: [nhusers] StaleObjectStateException: Row was updated or deleted by another transaction

2010-09-16 Thread Fabio Maulo
Tries to make this: Goes out from your work to take a walk in a park, then comeback and re-reads your e-mail and tries to imagine what can do somebody reading it. If you can't see anything wrong then tries this other thing: Call your best tech-friend and without add any word, and far away from

Re: [nhusers] Unique Constraint Error

2010-09-16 Thread Fabio Maulo
Only as curiosity. In your opinion, how can NH understand the correct sequence ? Obviously with a solution not strictly related to your two classes A and B. On Thu, Sep 16, 2010 at 3:16 AM, Sujith sujit...@gmail.com wrote: Hi, I am getting errors when updating fields which has a unique key

Re: [nhusers] Nhibernate.Linq 1.1.0.1001 has less methods implemented than 1.0.0.4000

2010-09-16 Thread Fabio Maulo
This is the second strange issue with the NH.Linq project of Contrib unfortunately we have deployed it in the same place of NH.Core... fortunately it won't happen anymore On Thu, Sep 16, 2010 at 6:41 PM, fedehf fedefre...@gmail.com wrote: Hi. I've just upgraded from NH.Linq 1.0.0.4000 to

Re: [nhusers] Arithmetic in a Criteria Query

2010-09-16 Thread Fabio Maulo
In a select ? The RDBMS exists only for an accident of IT and technology in general. You can do it in the class instead delegate it to the RDBMS... poor RDBMS.. it is so busy with a lot of other stuff and it is alone in its server in that cold room... On Wed, Sep 15, 2010 at 6:40 AM, grae123

Re: [nhusers] re: CreateSQLQuery That Returns Multiple Result Sets Only Returns First Result Set

2010-09-16 Thread Diego Mijelshon
You can submit it to http://jira.nhforge.org Diego On Wed, Sep 15, 2010 at 16:07, John Morales jmora...@gmail.com wrote: Hi all, I needed support for this so here it is. I don't know how to submit it, so the patch is attached. Let me know if it breaks something else and needs to be

Re: [nhusers] AliasToBean Transformer type conversion

2010-09-16 Thread Diego Mijelshon
Query substitutions just replace literals in HQL. They won't help him here. Diego On Wed, Sep 15, 2010 at 16:52, John Davidson jwdavid...@gmail.com wrote: You could look at query.substitutions in the NHibernate configuration property name=query.substitutionstrue 1, false 0, yes

[nhusers] Re: Super-type to Subtype

2010-09-16 Thread JideO
Its not simply that your object model is not correct but that things are just not modeled the way you have approached it. Generally when you create an object it does not change its class. Ever. What you are trying to do is have a object of a class that can be another class another time by making

Re: [nhusers] StaleObjectStateException: Row was updated or deleted by another transaction

2010-09-16 Thread harshil hameed
its related to version issue, my Version Column is null in that row, dats why NH can't check version of the row. after updating Version Column,Its working fine :) On Fri, Sep 17, 2010 at 4:47 AM, Fabio Maulo fabioma...@gmail.com wrote: Tries to make this: Goes out from your work to take a