[nhusers] Re: Multiple Session Factories...memory not released?

2011-02-10 Thread Byton
On Feb 10, 7:13 pm, Fabio Maulo wrote: > NHibernate 3.0 Cookbook page 253 > In alternative > :http://nhforge.org/wikis/howtonh/dynamically-change-user-info-in-conn... > Thanks, this looks promising. Perhaps caching should not be disabled when doing this or will the caches for the different dat

[nhusers] Spatial Tool for SQL Server 2005

2011-02-10 Thread angel
Hi, Anyone know where can download the spatial tool for SQL Server 2005? Thanks -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com. To unsubscribe from this group, send email to nhuser

[nhusers] Joining with ICriteria and fetching eagerly

2011-02-10 Thread Visar Uruqi
Hi I have the following Scenario... INVOICE | -->ITEMS (ISet) mapping: INVOICE Everything is fine and good but I'm having a problem with querying some specific scenario. SCENARIO: Client wants INVOICE'S THAT HAVE A CERTAIN ITEM WITH A CERTAIN DESCRIPTION var

Re: [nhusers] Assigning Default Catalog and Default Schema Property in Hibernate.cfg.xml

2011-02-10 Thread vinoth v
hi, Schema Name Rite??? what values will come here??? here connection details server name ,schema name,user name password will come that i know like default schema and default catalog what values need to assign. thanks in advance. On Thu, Feb 10, 2011 at 11:45 PM, Fabio Maulo wrote: > >

RE: [nhusers] Condition in join clause

2011-02-10 Thread Paul Hinett
Cool glad to have helped! From: nhusers@googlegroups.com [mailto:nhusers@googlegroups.com] On Behalf Of Craig van Nieuwkerk Sent: 11 February 2011 00:42 To: nhusers@googlegroups.com Subject: Re: [nhusers] Condition in join clause Thanks, using the example from here I got it working :-)

Re: [nhusers] Condition in join clause

2011-02-10 Thread Craig van Nieuwkerk
Thanks, using the example from here I got it working :-) http://stackoverflow.com/questions/1899718/fluentnhibernate-hasmanytomany-conditional-mappings Craig On Fri, Feb 11, 2011 at 11:05 AM, Paul Hi

Re: [nhusers] Condition in join clause

2011-02-10 Thread Craig van Nieuwkerk
Thanks, I will google as I have never used Session.EnableFilter before. On Fri, Feb 11, 2011 at 11:05 AM, Paul Hinett wrote: > I used session.enablefilter or something along them lines along with a > parameter just before my hql or criteria. > > Provides the correct sql for me anyway > > Sent fro

Re: [nhusers] Condition in join clause

2011-02-10 Thread Paul Hinett
I used session.enablefilter or something along them lines along with a parameter just before my hql or criteria. Provides the correct sql for me anyway Sent from my HTC - Reply message - From: "Craig van Nieuwkerk" To: Subject: [nhusers] Condition in join clause Date: Fri, Feb 11, 201

Re: [nhusers] Condition in join clause

2011-02-10 Thread Craig van Nieuwkerk
I don't think a filter will work because the value is a parameter that is passed to the query. Is this correct? Craig. On Fri, Feb 11, 2011 at 10:58 AM, wrote: > Not sure if you want to do it this way but I have used filters in the past > to achieve a and clause on a left outer join. > > Paul

Re: [nhusers] Condition in join clause

2011-02-10 Thread paul
Not sure if you want to do it this way but I have used filters in the past to achieve a and clause on a left outer join. Paul Sent from my android device. -Original Message- From: Craig van Nieuwkerk To: nhusers@googlegroups.com Sent: Thu, 10 Feb 2011 23:12 Subject: [nhusers] Condition

[nhusers] Condition in join clause

2011-02-10 Thread Craig van Nieuwkerk
I am using NHibernate 3.0 with QueryOver. I have the following query var query = Session.QueryOver(() => customFieldGroup) .JoinAlias(() => customFieldGroup.Organisation, () => organisation) .JoinAlias(() => customFieldGroup.Field

Re: [nhusers] NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Gunnar Liljas
Could you provide us with a ready to go project? I'd be happy to investigate. /g Sent from my iPad On Feb 10, 2011, at 3:37 PM, Paul Allington wrote: > Please excuse me for sending this again, but the last one descended into > comments on my test code rather than the issue - which is that th

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Paul Allington
If left for a while, it can grow to about 200MB - but still only aroun 5/6MB actually used...which is a little frustrating. ANTS say it's a fragmentation issue * * *Paul Allington [image: See my profile] * *T:* 01799 522 665 *M:* 07973 145

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Oskar Berggren
60MB isn't that much for many cases - depends of course on the intended deployment scenario. Though it would be irritating if it's unnecessary of course. A more important question is: is it growing over time? That could indicate a more serious memory leak. /Oskar 2011/2/10 Paul Allington : > Th

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Paul Allington
Thanks to you all! That makes sense, I'll sort that issue - that makes sense to me (I wonder if IUserType should be called IUserTypeMapper, just to make it easier to understand :) Doesn't seem to solve my big memory problem though. So peculiar. Although, with all this I've been doing in the last

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Oskar Berggren
Yes, surely the UserConfig instance you show in the retention graph is the single instance created as a consequence of the CustomType() call in your mapping. I'm not certain, but I would expect this single instance to stay as long as the session factory remains - destroying it and creating it again

Re: [nhusers] Assigning Default Catalog and Default Schema Property in Hibernate.cfg.xml

2011-02-10 Thread Fabio Maulo
On Thu, Feb 10, 2011 at 2:39 PM, vinoth v wrote: > What Values need to assign for For both the Property > > On 2/10/11, Fabio Maulo wrote: > > try to add the nhibernate-configuration.xsd to de editor in Visual Studio > > > > On Thu, Feb

Re: [nhusers] Re: Multiple Session Factories...memory not released?

2011-02-10 Thread Fabio Maulo
NHibernate 3.0 Cookbook page 253 In alternative : http://nhforge.org/wikis/howtonh/dynamically-change-user-info-in-connection-string.aspx On Thu, Feb 10, 2011 at 3:03 PM, Byton wrote: > On Feb 10, 6:08 pm, Fabio Maulo wrote: > > ehm... 500 to 1000 what ? > > Are you sure that you really need 50

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Jason Meckley
Kor may be on to something with your IUserType implementation. IUserTypes are not part of the domain, they are part of the infrastructure. a user type tells NH when give object X convert it to schema Y. -- You received this message because you are subscribed to the Google Groups "nhusers" grou

[nhusers] Re: Multiple Session Factories...memory not released?

2011-02-10 Thread Byton
On Feb 10, 6:08 pm, Fabio Maulo wrote: > ehm... 500 to 1000 what ? > Are you sure that you really need 500 to 1000 sessionFactories ? > Have you 500 to 1000 different schema in your application used by 30 to 50 > concurrent users ? > Fabio Maulo No, sorry; It's 1000 databases with the exact same

[nhusers] Re: Multiple Session Factories...memory not released?

2011-02-10 Thread Byton
On Feb 10, 4:07 pm, Jason Meckley wrote: > GC runs in the background, The memory will be released when GC occurs, but > that may not be the instant you call dispose. No, at least in my setup the memory would never be released...memory usage would just increase and increase. An explicit GC.Colle

Re: [nhusers] Assigning Default Catalog and Default Schema Property in Hibernate.cfg.xml

2011-02-10 Thread vinoth v
What Values need to assign for For both the Property On 2/10/11, Fabio Maulo wrote: > try to add the nhibernate-configuration.xsd to de editor in Visual Studio > > On Thu, Feb 10, 2011 at 8:16 AM, vino wrote: > >> Hi All, >> >> In Hibernate.cfg.xml File How to assign >> and >> values for Mysql

Re: [nhusers] Re: Mapping a within a

2011-02-10 Thread Fabio Maulo
Is only regarding an old and always new story http://fabiomaulo.blogspot.com/2009/06/database-eliot-ness-of-it.html On Thu, Feb 10, 2011 at 4:35 AM, Mike Pontillo wrote: > Thanks for the response Fabio, > > I'm not sure exactly what you mean though. ;-) I wish the DB design > could be changed,

Re: [nhusers] Re: Collection with related association

2011-02-10 Thread Fabio Maulo
the real matter, IMO, is that nullable is the default in NH. If you want something as not-nullable, in NH, you have to specify it explicitly. On Thu, Feb 10, 2011 at 2:26 PM, Giovanni Bassi wrote: > Guys, > I just found out the answer. > Here is the family: > > public class Family : Entity >

Re: [nhusers] Converting an Expression to and HQL string

2011-02-10 Thread Fabio Maulo
well.. if you really want the same behavior of session.Delete(string) then the work to do is only an extension method as for instance: public static void Delete(this session, IQueriable query) { Array.For(query.ToArray(), x=> session.Delete(x)); } On Thu, Feb 10, 2011 at 5:21 AM, Glenn wrote: >

[nhusers] Re: Collection with related association

2011-02-10 Thread Giovanni Bassi
Guys, I just found out the answer. Here is the family: public class Family : Entity { public Family() { Members = new List(); } public virtual IList Members { get; set; } public virtual Person Father { get; set; } public virtual s

Re: [nhusers] Assigning Default Catalog and Default Schema Property in Hibernate.cfg.xml

2011-02-10 Thread Fabio Maulo
try to add the nhibernate-configuration.xsd to de editor in Visual Studio On Thu, Feb 10, 2011 at 8:16 AM, vino wrote: > Hi All, > > In Hibernate.cfg.xml File How to assign > and > values for Mysql And SqlLite Database > > Thanks in Advance > > -- > You received this message because you are su

Re: [nhusers] Multiple Session Factories...memory not released?

2011-02-10 Thread Fabio Maulo
ehm... 500 to 1000 what ? Are you sure that you really need 500 to 1000 sessionFactories ? Have you 500 to 1000 different schema in your application used by 30 to 50 concurrent users ? On Thu, Feb 10, 2011 at 9:54 AM, Byton wrote: > I'm using NHibernate (3.0.0.GA) in a client/server application

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Greg Young
ISression session = ManagedWebSessionContext.Unbind(HttpContext.Current, SessionSource.Instance.SessionFactory); if (session == null) return; session.Close(); session.Dispose(); GC.Collect(); whether or not session is still held at the

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Paul Allington
Afraid that's not it, thanks though Paul On Thu, Feb 10, 2011 at 4:24 PM, John Davidson wrote: > I would change your CreateUser call so that it is not static. This may be > why the reference is being retained. > > John Davidson > > > On Thu, Feb 10, 2011 at 11:10 AM, Paul Allington < > p...@in

[nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread kor
the isertype must not be used in your domain object, you use for the property User.Config a List (or a sub type if you need same custom behaviour) and in an external class you implement the iuser type. then on the mapping file you associate your implementation of iusertype with that property (ie w

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Greg Young
I would not expect this to be related. On Thu, Feb 10, 2011 at 11:24 AM, John Davidson wrote: > I would change your CreateUser call so that it is not static. This may be > why the reference is being retained. > John Davidson > > On Thu, Feb 10, 2011 at 11:10 AM, Paul Allington > wrote: >> >> Ok

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread John Davidson
I would change your CreateUser call so that it is not static. This may be why the reference is being retained. John Davidson On Thu, Feb 10, 2011 at 11:10 AM, Paul Allington < p...@intelligentpenguin.co.uk> wrote: > Ok - have included some code here (please please don't comment on the code > its

Re: [nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Paul Allington
Ok - have included some code here (please please don't comment on the code itself - I wrote this purely to test this problem, it's not supposed to be production ready code). I've added a GC.Collect() to the end of the module so that anything in the memory snapshot is part of the problem. I've onl

Re: [nhusers] Re: HOWTO: one to many, simple entity collection mapping.

2011-02-10 Thread Joe Brockhaus
"This would seem to be my best option because i know what cascade setting i need at the time it's added to the nhib session?" -- that is .. if i can't easily map like it's an 'AND' world. I'm going to try the double-inverse that someone mentioned before. -- You received this message because you a

Re: [nhusers] Re: HOWTO: one to many, simple entity collection mapping.

2011-02-10 Thread Joe Brockhaus
After reading up some more on stack overflow and through hibernate (java, understanding this is a port) documentation, that it may be possible to specify cascade behavior at the time of a call? This would seem to be my best option because i know what cascade setting i need at the time it's added t

[nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Jason Meckley
Is it that you have a memory leak, or you think NH should just use less memory? try removing the IUserTypes and just map to primitive values. See what happens to the memory consumption then. If it drops, then you can start by investigating the IUserTypes. Kor's correct, without code or context

[nhusers] Re: Multiple Session Factories...memory not released?

2011-02-10 Thread Jason Meckley
GC runs in the background, The memory will be released when GC occurs, but that may not be the instant you call dispose. I can only imagine 1 scenario where you would need 100+ session factories: multitenancy. There are ways to map a multitenant application with a single session factory which wi

[nhusers] Re: NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread kor
without the code is impossible, anyhow it's more probable that the bug is in your code (for example iusertype). try to investigate if you have same static variables. anyhow try to split your code to find exactly what is allocating and not releasing the memory and then submit code that reproduce it

[nhusers] Re: HOWTO: one to many, simple entity collection mapping.

2011-02-10 Thread Jason Meckley
@Jide: this type of approach is along the lines of CRUD instead of ORM. the purpose of ORM is to work with objects, not a database. Therefore you would load the entire object into memory. If you want to query specific columns you are talking about projections. in ORM terms projections are a read

Re: [nhusers] Collection with related association

2011-02-10 Thread Paulo Quicoli
Hi Giovanni. So, Family looks like; public class Family { public Person Father{get;set;} public IList Members{get;set;} } I'd introduce a method like this (or just code it in Father property set method) public void SetFatherForFamily(person newFather) { var familyMember = from m in

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread John Davidson
With respect to unmanaged code log4net uses 3 system level dll and the libc library, while NHibernate has links to some diagnostic code which references to VisualC libraries. This can be verified through Reflector John Davidson On Thu, Feb 10, 2011 at 9:28 AM, Jason Meckley wrote: > @jwdavidson:

[nhusers] NHibernate eats memory - again (memory leak in unmanaged code...)

2011-02-10 Thread Paul Allington
Please excuse me for sending this again, but the last one descended into comments on my test code rather than the issue - which is that there's an unmanaged memory leak somewhere in nhibernate, and I'd like to find it as it's costing me a lot of memory So far: - a simple 1 page web app uses about

[nhusers] Collection with related association

2011-02-10 Thread Giovanni Bassi
Hi guys, Let's say I have a class Family, which has a collection of Persons, the members of the family (father, son, etc). I need to be able to get all my family members through the Members property of the Family class. And I also need to know specifically who the father of the family is. So I nee

[nhusers] Multiple Session Factories...memory not released?

2011-02-10 Thread Byton
I'm using NHibernate (3.0.0.GA) in a client/server application where the server will access multiple databases using a SessionFactory for each database. For smaller installations this seems to work fine but for larger installations (500-1000 databases but only 30-50 users total) memory usage is

[nhusers] QueryOver for nested objects

2011-02-10 Thread Vikas
Hi, I am planning to migrate from Nhibernate 2.x to NH3 and as part of it we are also looking at moving away from NHibernate linq (contrib project) to the inbuilt linq and query over options. I understand that QueryOveris a wrapper on top of the criteria and hence shares almost the same restricti

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread Jason Meckley
@jwdavidson: yes, I would structure the code so each request is a single unit of work. a request will either alter data (command) or retrieve data (query). never both. typically I have a single session per request and manage transactions using a filter/decorator. this allows me to by pass the tr

[nhusers] group ba a property without selecting it

2011-02-10 Thread Armin Landscheidt
Is it possible to group by a property without selecting the property? var subquery = DetachedCriteria.For("teacher") .CreateCriteria("Pupil", "pupil") .SetProjection( Projections.ProjectionList() .Add(Projections.GroupProperty("pupil.Id")) .Add(Property.ForName("teacher.Id").Max().As("maxId")));

Re: [nhusers] Exception occurred getter of Ordering.Data.Contact.ID

2011-02-10 Thread Markus Zywitza
Try these for understanding generators, especially the problem with post-insert generators (IDENTITY): http://fabiomaulo.blogspot.com/2009/02/nh210-generators-behavior-explained.html http://nhforge.org/blogs/nhibernate/archive/2009/03/20/nhibernate-poid-generators-revealed.aspx -Markus 2011/2/10

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread John Davidson
Transactions are mandatory for all DB accesses including reads, not just writes. code should be private static void GetUser(ISessionFactory sessionFactory, int userId) { ISession session = sessionFactory.GetCurrentSession(); using (var tx = session.BeginTra

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread Paul Allington
I've also written a really simple web example to show a data entity hanging around in memory after the request is finished with: If I call "Get(userId)" - the User object is still in memory once the request has ended (GC has been run)..aaany ideas? *Code sample:* protected void Page_

[nhusers] Assigning Default Catalog and Default Schema Property in Hibernate.cfg.xml

2011-02-10 Thread vino
Hi All, In Hibernate.cfg.xml File How to assign and values for Mysql And SqlLite Database Thanks in Advance -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com. To unsubscribe from this gr

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread Paul Allington
I've just written a reeeally simple console app to try and find where this unmanaged memory is coming from...8.7MB to 22MB is quite a jump - what's using it? Is that really runtime? Results: *Start of the App* Task Manager: 5,976 K Gen 1 Objects: 39.77 KB Gen 2 Objects: 0 Large Object Heap: 35.5

[nhusers] Mapping Lookup-Table

2011-02-10 Thread Smokefoot
Hi, i have a little discussion with my self and i dont find the right answer. For example i have a small blog. Article(Id, Title, Text) <- ID = INT, PK Tag(Tag) <- Tag = PK, Varchar TagSet(ArticleId, Tag) <-- all FK Good.. the matter is that i want to reduce performance issues. So i dont want to

[nhusers] Re: Linq Except method not implemented

2011-02-10 Thread hoghweed
I'm really sorry I didn't post the exact exception, but it was the classic message "the method blabla is not implemented"... My question is, is not possible till now as I saw, to know exactly which of the Linq extension methods is no more supported? So it's a big lie when it's said that the break

Re: [nhusers] NHibernate eats memory

2011-02-10 Thread Paul Allington
Thanks for that - very helpful. The snapshot is being taken after the request has completed. Am I the only one who has a large chunk of unmanaged memory allocated when I use nhibernate? * * *Paul Allington [image: See my profile] * *T:* 0

[nhusers] Re: LINQ Fetch

2011-02-10 Thread Stefan Wenig
You're right, I take that back. Thought we were talking about explicit outer joins, but implicit outer joins via fetch should work. On Feb 9, 10:34 am, cremor wrote: > It should work if you place the Fetch() calls after all other > statements (in your case the where). > Either reorder your statem

Re: [nhusers] Converting an Expression to and HQL string

2011-02-10 Thread Glenn
@Fabio Yes, that is the code I'd like to create, but not manually. I have the expression and would like to automatically create the HQL required. Some more info: We're using LinqSpec for writing query specifications and would like to use the same specifications for deleting stuff. Basically do a