[nhusers] Re: LinqToNhibernate, JOIN, Expand

2010-03-24 Thread Hawkwood
Yes, I have test this but that doesn't functionned. There is a bug of Nhibernate Linq ? But if i do this : var ldossier = (from dos in session.LinqDossier().Expand(ListeLogicielDossier) where dos.CodeDossier == 0114 select

[nhusers] Re: Lazy loading trap: private property setter, internal method calling it

2010-03-24 Thread Stefan Steinegger
I can't see a warning in the log. It verifies that every (non-private) member is at least virtual protected. internal protected is accepted by the session factory, but doesn't seem to work. On 22 Mrz., 17:12, Fabio Maulo fabioma...@gmail.com wrote: I think you should have a WARNING in the log.

[nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread Ramon Smits
You can either specifiy eager loader with the criteria api by using .SetFetchMode(YourOneToOneRelation, FetchMode.Eager). You can also do stuff like this: .SetFetchMode(RelationToA, FetchMode.Select) .SetFetchMode(RelationToA.RelationAToB, FetchMode.Eager) Which would not immediately result in

[nhusers] Eager loading behavior for M-N relations

2010-03-24 Thread Ramon Smits
I have the following database model: Data -- DataLanguage -- Language In code I can access these like this: Data.Languages I want to do a eager load of these items on data status. The way I would do that in SQL is this: 1st roundtrip: Fetch matching data items and the data language keys

[nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread James Crowley
Hi guys, I keep getting IndexOutOfRangeException's on the current trunk (with code that worked fine in NH 2.1) because it's looking for the primary key in the resultset with square brackets round the column name ([QueuedTaskId] instead of QueuedTaskId) - I've checked and the exception doesn't

Re: [nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread Fabio Maulo
which is the query ? 2010/3/24 James Crowley james.crow...@gmail.com Hi guys, I keep getting IndexOutOfRangeException's on the current trunk (with code that worked fine in NH 2.1) because it's looking for the primary key in the resultset with square brackets round the column name

Re: [nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread Robert Rudduck
The ` quotes on the column name are probably doing it. On Wed, Mar 24, 2010 at 6:38 AM, James Crowley james.crow...@gmail.comwrote: Hi guys, I keep getting IndexOutOfRangeException's on the current trunk (with code that worked fine in NH 2.1) because it's looking for the primary key in the

[nhusers] Re: Lazy loading trap: private property setter, internal method calling it

2010-03-24 Thread Nexus
Hi, Without questioning the implementation ;), it has nothing to do with proxying as the proxy should have loaded all values as a result from Assert.AreEqual(A, obj.PrivateSetter) Or is it caused by the private set {} itself ?? (What is the mapping here nosetter.camelcase ???), could be that

Re: [nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread James Crowley
I checked and the `quotes are a valid syntax for escaping table names in the NH mapping (it was discussed here: http://code.google.com/p/fluent-nhibernate/issues/detail?id=55) And just to follow up, it does look like a NamedQuery issue after all. Calling Session.GetQueuedJob((long)0); //

[nhusers] Re: Lazy loading trap: private property setter, internal method calling it

2010-03-24 Thread Stefan Steinegger
OK, I just tried with the castle dynamic proxies (before i had LinFu) AND IT WORKS!! This means, that it is a problem with LinFu proxies! The proxy did load the values, but they are not accessible by the non- public members. NH seems to create two instances of the entity, one that is derived from

Re: [nhusers] IndexOutOfRange exceptions on current trunk

2010-03-24 Thread Fabio Maulo
If you put square brackets (quoting in the mapping) you should put square brackets in your SP. If you use a mapping-system that puts square brackets everywhere, instead uses it only where really needed (as NH2.1.0 do), you should adapt your work to your choose. I don't need to do it because: I

[nhusers] Nhibernate Select / Update Order

2010-03-24 Thread Sal
I have a weird issue in a WebForms app that is using session per request. On a certain screen we update some fields, update the entity and then save it. The problem occurs if we set an entity to not active. The select queries exclude entities that are not active. So, looking at NH profiler, the

[nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread jprid64
Fabio, I'll get working on ConfORM and let you know. The xml snippet is supposed be telling NH that the ID for the primary table is also the key into the Plan object (which is my one-to-one association). On Mar 24, 12:01 am, Fabio Maulo fabioma...@gmail.com wrote: Try to map your domain with

Re: [nhusers] Nhibernate Select / Update Order

2010-03-24 Thread Oskar Berggren
You speak of updating and saving an entity. Why is there a select there at all? I think you need to explain more about how your code works. /Oskar 2010/3/24 Sal salbass...@hotmail.com: I have a weird issue in a WebForms app that is using session per request. On a certain screen we update some

[nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread jprid64
The app seems to run the same without that snippet, so consider it removed. On Mar 24, 10:07 am, jprid64 john.pride...@gmail.com wrote: Fabio, I'll get working on ConfORM and let you know. The xml snippet is supposed be telling NH that the ID for the primary table is also the key into the

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
It needs to select to bind the entities to the view. On Mar 24, 11:07 am, Oskar Berggren oskar.bergg...@gmail.com wrote: You speak of updating and saving an entity. Why is there a select there at all? I think you need to explain more about how your code works. /Oskar 2010/3/24 Sal

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Oskar Berggren
More specifically, to you mean rebind after the entity have been updated? /Oskar 2010/3/24 Sal salbass...@hotmail.com: It needs to select to bind the entities to the view. On Mar 24, 11:07 am, Oskar Berggren oskar.bergg...@gmail.com wrote: You speak of updating and saving an entity. Why is

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Yes, indeed. On Mar 24, 11:27 am, Oskar Berggren oskar.bergg...@gmail.com wrote: More specifically, to you mean rebind after the entity have been updated? /Oskar 2010/3/24 Sal salbass...@hotmail.com: It needs to select to bind the entities to the view. On Mar 24, 11:07 am, Oskar

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Robert Rudduck
Depending on how abstracted your NH usage is, you could call flush after the update, which would force the update to fire. Then the selects afterward would return the right results. - Robert On Wed, Mar 24, 2010 at 10:29 AM, Sal salbass...@hotmail.com wrote: Yes, indeed. On Mar 24, 11:27 am,

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Depending on how abstracted your NH usage is, you could call flush after the update, which would force the update to fire. Then the selects afterward would return the right results. Yeah, I did that in one other place. I guess it just seems weird...meaning, I must be doing something wrong with

Re: [nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread Diego Mijelshon
For many-to-one you can use batch-size in the referenced class declaration. Diego On Wed, Mar 24, 2010 at 00:14, jprid64 john.pride...@gmail.com wrote: Thanks, Diego. That worked (sort of) for my one-to-many. I set the batch size to 20 (knowing I would only get 15 based on the data I'm

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Oskar Berggren
Your current FlushMode affects this behavior as well. FlushMode.Auto should cause the update to happen before the select. /Oskar 2010/3/24 Robert Rudduck rob...@rpowered.net: Depending on how abstracted your NH usage is, you could call flush after the update, which would force the update to

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
I am using the default (assuming Fluent Nhibernate uses the same default) which I believe is Commit? I wonder what other side effects would appear if I changed that to Auto. On Mar 24, 11:34 am, Oskar Berggren oskar.bergg...@gmail.com wrote: Your current FlushMode affects this behavior as well.

[nhusers] Re: Lazy loading trap: private property setter, internal method calling it

2010-03-24 Thread Nexus
Thanks for the update :), i personally don't trust anything with foo(fu) or bar in it :P -- 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 email to

Re: [nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread Fabio Maulo
That mapping does not mean nothing well only mean that *you* will set the ID. 2010/3/24 jprid64 john.pride...@gmail.com Fabio, I'll get working on ConfORM and let you know. The xml snippet is supposed be telling NH that the ID for the primary table is also the key into the Plan object

[nhusers] Re: custom type is not Serializable error with XML UserType

2010-03-24 Thread Chris J
Thanks, that worked. I thought I had read that .NET assumes a class is serializable by default, so I didn't think I needed the attribute. -- 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.

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Well, my unit of work is around the request and the commit happens at the end, so I can't really commit it early. Someone on our team did set the flushmode to commit - we weren't using auto. I am tempted to set it to auto, but I have also ready many negative things about using auto, performance

[nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread jprid64
Sorry -- I wasn't clear. I removed the param tag with no side effects. Yes, I am responsible for the ID with generator class=assigned. On Mar 24, 11:02 am, Fabio Maulo fabioma...@gmail.com wrote: That mapping does not mean nothing well only mean that *you* will set the ID. 2010/3/24

[nhusers] nhibernate.linq won't download

2010-03-24 Thread tqwhite
it shows an 88k file and gives me errors. Does anyone know someplace other than sourceforge I can get it? tqii -- 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

Re: [nhusers] nhibernate.linq won't download

2010-03-24 Thread Tuna Toksoz
Are you using windows zip utility? Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Wed, Mar 24, 2010 at 6:40 PM, tqwhite tqwh...@gmail.com wrote: it shows an 88k file and gives me errors. Does

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Oskar Berggren
If you can get access to the ISession, or some wrapper, you could call Flush() on it to force the flush before select. /Oskar 2010/3/24 Sal salbass...@hotmail.com: Well, my unit of work is around the request and the commit happens at the end, so I can't really commit it early. Someone on our

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
If you can get access to the ISession, or some wrapper, you could call Flush() on it to force the flush before select. Yep, I will do that. Is this considered bad practice? On Mar 24, 12:42 pm, Oskar Berggren oskar.bergg...@gmail.com wrote: If you can get access to the ISession, or some

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread John Davidson
It is somewhat not great practice, as the view manager must now be fully NHibernate aware, rather than having NHibernate abstracted. John Davidson On Wed, Mar 24, 2010 at 12:54 PM, Sal salbass...@hotmail.com wrote: If you can get access to the ISession, or some wrapper, you could call

Re: [nhusers] Re: Reduce # of queries on one-to-one or one-to-many association

2010-03-24 Thread Fabio Maulo
Instead try ConfORM you can have a look to my post and learn how ConfORM map a one-to-one... welll... there you can see even how you can map a one-to-one in XML ;) http://fabiomaulo.blogspot.com/2010/03/conform-mapping-one-to-one.html 2010/3/24 jprid64 john.pride...@gmail.com Sorry -- I wasn't

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
It is somewhat not great practice, as the view manager must now be fully NHibernate aware, rather than having NHibernate abstracted. Well, it's actually happening in a service class. So, this solution does not leak NH. On Mar 24, 1:01 pm, John Davidson jwdavid...@gmail.com wrote: It is

[nhusers] Re: nhibernate.linq won't download

2010-03-24 Thread tqwhite
I'm using whatever Explorer chooses. I assume it's the Windows utility. It's only downloading about 88k. When I try to download it on a Macintosh, it gives me a download error. This happened to me before when I tried to download NH itself. That error just went away. (Nice of time, too, I'd have

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread John Davidson
Well if you can call Flush() in the service component, why couldn't you call Commit(), which would then do a Flush()? John Davidson -- 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

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Fabio Maulo
I have only two questions. Why a query to DB, in the middle of a UoW, should include changes suspended in the UoW ? The UoW's definition is here http://martinfowler.com/eaaCatalog/unitOfWork.html Which is your interpretation of UoW pattern ? 2010/3/24 Sal salbass...@hotmail.com It is

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Well if you can call Flush() in the service component, why couldn't you call Commit(), which would then do a Flush()? Yeah, I guess I could. This a bit of a departure from our current approach, so I need to think it through. My current unit of work implementation is handled at the http request

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Well if you can call Flush() in the service component, why couldn't you call Commit(), which would then do a Flush()? Yeah, I guess I could. This a bit of a departure from our current approach, so I need to think it through. My current unit of work implementation is handled at the http request

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Well if you can call Flush() in the service component, why couldn't you call Commit(), which would then do a Flush()? Yeah, I guess I could. This a bit of a departure from our current approach, so I need to think it through. My current unit of work implementation is handled at the http request

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
Well if you can call Flush() in the service component, why couldn't you call Commit(), which would then do a Flush()? Yeah, I guess I could. This a bit of a departure from our current approach, so I need to think it through. My current unit of work implementation is handled at the http request

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread John Davidson
As Fabio suggests, a UoW is not equivalent to an http request. A UofW should be a complete action within a database context. Normally a query, or very infrequently a series of queries, may make a unit of work. You should call Commit at that point. Then when you start your update you begin a new

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
I have only two questions. Why a query to DB, in the middle of a UoW, should include changes suspended in the UoW ? The UoW's definition is herehttp://martinfowler.com/eaaCatalog/unitOfWork.html Which is your interpretation of UoW pattern ? Fabio, That is a great point. To be honest, I

[nhusers] Re: nhibernate.linq won't download

2010-03-24 Thread tqwhite
Another detail, in case there are any Masters watching, is that the current version, 2.1.2, is only 88.1kB. There previous version, 1.0.0, is 2.3MB. Nothing slims down that much. tqii On Mar 24, 12:33 pm, tqwhite tqwh...@gmail.com wrote: I'm using whatever Explorer chooses. I assume it's the

[nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread Sal
As Fabio suggests, a UoW is not equivalent to an http request. A UofW should be a complete action within a database context. Normally a query, or very infrequently a series of queries, may make a unit of work. You should call Commit at that point. So, are you saying that I should view this as

RE: [nhusers] Re: nhibernate.linq won't download

2010-03-24 Thread Michael A. Bell
I had issues with the download as well. The download I did was just the 2.1.2-GA-Bin zip file from sourceforge. The file size for me was 87KB, however using windows compression tool to unzip caused an error saying it could not open the folder. I actually had to download winrar and open it

[nhusers] Method get_ProxyValidator does not have an implementation.

2010-03-24 Thread JohnT
Hey, I'm trying to get my site to run on a webhost with medium trust, I followed the blog post at (http://nhforge.org/wikis/howtonh/pre- generate-lazy-loading-proxies.aspx) to pre-generate the proxies. The proxy generates ok but when I run it it throws the following exception. Method

Re: [nhusers] Re: Nhibernate Select / Update Order

2010-03-24 Thread John Davidson
Yes, just displaying data requires 1 transaction. to update date there is a minimum of 2 transactions. If you create data and want the user to see it then there is also 2 transactions minimum. there is only one ISession object per http request John Davidson On Wed, Mar 24, 2010 at 2:17 PM, Sal

[nhusers] HiLo: when does the entity receive the id?

2010-03-24 Thread Jason Meckley
I am spiking an example of CQRS as described by Udi. I am using rhino service bus to process commands and then fire events in the domain. I'm using a 'To Do List' for the spike public void Consume(NewQuickTask message) { var task= session.GetUser(message.UserId).AddTask(message.Title);

Re: [nhusers] HiLo: when does the entity receive the id?

2010-03-24 Thread Greg Young
If you are spiking a greenfield app with CQRS using nhibernate or any orm will lead to a complete and utter failure. On Wed, Mar 24, 2010 at 8:48 PM, Jason Meckley jasonmeck...@gmail.com wrote: I am spiking an example of CQRS as described by Udi. I am using rhino service bus to process commands

[nhusers] Re: nhibernate.linq won't download

2010-03-24 Thread tqwhite
Winrar did the job. Thanks Michael! Does anyone know why? tqii On Mar 24, 1:18 pm, Michael A. Bell mb...@interactivesoftworks.com wrote: I had issues with the download as well.  The download I did was just the 2.1.2-GA-Bin zip file from sourceforge.  The file size for me was 87KB, however

[nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Jason Meckley
Greg, thank you the *concise* response :) care to elaborate? I can see how my design may fail, but how can a tool fail? If I choose Guid as my id, my approach might work. If I choose Identity (or some other db POID) this will definitely work. I'm hoping there's is 3rd option which I'm not aware

Re: [nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Greg Young
How do you prove that the events that you publish to the reporting model (and every other model) from your domain match what nhibernate (or any other ORM) believes your changes to be? It is a difficult problem and the models,your database model and your eventing model, will diverge over time

[nhusers] Unexpected behavior when making changes to a transient object

2010-03-24 Thread ragamuf
I created an entity via the default constructor and added it my unit of work immediately via Session.Save. I then made subsequent changes to this entity prior to commit. I would have expected a single insert with the changes aggregated. However, what I see is an insert with the default profile

RE: [nhusers] Re: nhibernate.linq won't download

2010-03-24 Thread Michael A. Bell
No idea, but I have seen this on several zip files in the past that have nothing to do with NHibernate or eachother. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of tqwhite Sent: Wednesday, March 24, 2010 2:58 PM To: nhusers Subject:

Re: [nhusers] Unexpected behavior when making changes to a transient object

2010-03-24 Thread Diego Mijelshon
Your expectation is not correct. If you Save a transient instance and then modify it, it will be saved with the original values first and then updated. You'll need to make sure you don't call save on an invalid object. Diego On Wed, Mar 24, 2010 at 15:29, ragamuf raga...@gmail.com wrote: I

[nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Jason Meckley
the possibility does exist for the pvm and domain to be out of sync. I understood this as eventual consistency. Are you talking about permanently loosing consistency. Like entire handlers not succeeding? Lets assume that events will succeed. in my current architecture the domain and pvm are

Re: [nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Greg Young
This has nothing to do with eventual consistency... This has to do with the fact that you have 2 models and 2 ways of detecting changes. How do you insure they find the same changes? Greg On Wed, Mar 24, 2010 at 10:09 PM, Jason Meckley jasonmeck...@gmail.com wrote: the possibility does exist

[nhusers] Re: Unexpected behavior when making changes to a transient object

2010-03-24 Thread ragamuf
yep. I came to the same conclusion painfully. On Mar 24, 4:04 pm, Diego Mijelshon di...@mijelshon.com.ar wrote: Your expectation is not correct. If you Save a transient instance and then modify it, it will be saved with the original values first and then updated. You'll need to make sure you

Re: [nhusers] HiLo: when does the entity receive the id?

2010-03-24 Thread Fabio Maulo
Use session.Persist instead session.Save but take care with session.Persist if you aren't using XML to map NH well I mean if you are not using neither XML nor ConfORM. 2010/3/24 Jason Meckley jasonmeck...@gmail.com I am spiking an example of CQRS as described by Udi. I am using rhino

Re: [nhusers] Re: Help

2010-03-24 Thread Dewang Lakhani
Thanks for all the info, but I am getting following exception: NHibernate.HibernateException was unHandeled Message=Could not create the driver from NHibernate.Driver.OracleLiteDataClientDriver. I have downloaded the NHibernate-2.1.2.GA-bin.zip , I hope this has Oracle Lite support as it is a

[nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Jason Meckley
I have one way commands coming from the client. the commands are consumed. consuming includes 1. Nh getting entity(s) and updating 2. sending events in the domain stating this happened. it seems natural to me, what am I missing? On Mar 24, 4:10 pm, Greg Young gregoryyou...@gmail.com wrote: This

Re: [nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Greg Young
what does nhibernate save to the database? what were your events to to the reporting side? are they the same? can you prove it? what if they aren't? On Wed, Mar 24, 2010 at 11:35 PM, Jason Meckley jasonmeck...@gmail.com wrote: I have one way commands coming from the client. the commands are

[nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Jason Meckley
Fabio, are you saying session.persist for saving the task (HiLo POID) or the pvm? On Mar 24, 5:29 pm, Fabio Maulo fabioma...@gmail.com wrote: Use session.Persist instead session.Save but take care with session.Persist if you aren't using XML to map NH well I mean if you are not using

Re: [nhusers] Re: HiLo: when does the entity receive the id?

2010-03-24 Thread Fabio Maulo
/// summary /// Make a transient instance persistent. This operation cascades to associated /// instances if the association is mapped with ttcascade=persist/tt.br/ /// The semantics of this method are defined by JSR-220. /// /summary /// param name=obja transient instance to be made persistent

[nhusers] Re: Collection was not processed by flush()

2010-03-24 Thread Michael diSibio
Wondering if this is officially a bug and will it get fixed? We have no listener on Flush events, only on the PostInsert/Update/ Delete and PostCollectionRecreate/Update/Remove. We have implemented a Unit of Work pattern, in which we set FlushMode to Never and explicitly call Flush(); Our

Re: [nhusers] Re: Collection was not processed by flush()

2010-03-24 Thread Fabio Maulo
Probably is Not a bug. Are you loading a collection inside your listeners ? 2010/3/24 Michael diSibio michael.disi...@gmail.com Wondering if this is officially a bug and will it get fixed? We have no listener on Flush events, only on the PostInsert/Update/ Delete and

[nhusers] Re: CriteriaImpl.Timeout vs Session.Connection.ConnectionTimeout

2010-03-24 Thread Michael diSibio
I'd just like to bump this. I posted originally on a late Friday afternoon, so I guess everyone went home. On Mar 12, 5:02 pm, Michael diSibio michael.disi...@gmail.com wrote: What we observed: - An explicit timeout set by 'Connect Timeout' clause in a connection string in the configuration