[nhusers] Re: SqlException: Distributed Transaction Completed

2009-04-06 Thread Will Shaver
else it works fine.  It is just something to do > with this transaction but I the exception is EXTREMELY vague. > > Thanks, > Josh > > On Apr 6, 9:35 am, Will Shaver wrote: >> What does the [Rollback] attribute do? >> Does it set up a session and a transaction? If

[nhusers] Re: SqlException: Distributed Transaction Completed

2009-04-06 Thread Will Shaver
What does the [Rollback] attribute do? Does it set up a session and a transaction? If so you're doing one transaction inside of another... On Mon, Apr 6, 2009 at 7:23 AM, joshlrogers wrote: > > I am running a test: > >        [Test] >        [Rollback] >        public void CanDeleteRatingGroupBy

[nhusers] Re: NHibernate.AssertionFailure

2009-04-03 Thread Will Shaver
I think he means you only need to reset the session, and shouldn't need to reset the session factory. On Fri, Apr 3, 2009 at 11:31 AM, joshlrogers wrote: > > I don't mean to be dense, but what do you mean? > > On Apr 3, 11:29 am, Fabio Maulo wrote: >> Is enough with session. >> >> 2009/4/3 josh

[nhusers] Re: NHibernate Inheritance issue

2009-04-03 Thread Will Shaver
If you really need this functionality you probably could update the table manually. Assuming that you're using the table-per-inheritance this isn't that bad. (Where both vendor and person are in the same table.) You'll have a row in the db like ID, Subclass, Version, Name, Birthday, Address ...

[nhusers] Re: Encrypt password

2009-04-01 Thread Will Shaver
Code Camp Server - an open source project that uses NH does this: http://code.google.com/p/codecampserver/ it does encrypt passwords. Search the codebase on google code for "salt" and you'll find the relavant bits. It references this: http://davidhayden.com/blog/dave/archive/2004/02/16/157.aspx O

[nhusers] Re: Nullable Values

2009-03-30 Thread Will Shaver
t; deal as I am writing unit tests but when I go to implement this I have >> > to have this resolved.  I understand we said it is not NH because the >> > stand alone test worked.  However, if I take NH out of the picture I >> > get nulls as I should so I don't want

[nhusers] Re: Nullable Values

2009-03-30 Thread Will Shaver
       public virtual DateTime? DateEdited >        { >            get { return _DateEdited; } >            set { _DateEdited = value; } >        } > >    } > } > > Thank you, > Josh > > On Mar 30, 12:06 pm, John Rayner wrote: >> We're using nullable va

[nhusers] Re: Nullable Values

2009-03-30 Thread Will Shaver
t; >> > > > Is there something I can doI am thinking this is me because I am >> > > > sure there have been others that needed to do the same thing and would >> > > > have run into this issue.  I really have exhausted my resources as to >> &g

[nhusers] Re: Nullable Values

2009-03-27 Thread Will Shaver
/> > > > > > > > This still gives me a 1 for UserEdited and the current date for > DateEdited. However if I do a SELECT query from the DB those values > are null and if I do a dataset and do the query myself they are null. > The issue is def

[nhusers] Re: Nullable Values

2009-03-27 Thread Will Shaver
will still need the type > attribute. (For example, to distinguish between > NHibernateUtil.DateTime and NHibernateUtil.Timestamp, or to specify a > custom type.)" > > On Mar 27, 4:03 pm, Will Shaver wrote: > > Ack, of course epitka is right. Remember that nullable types are a

[nhusers] Re: Nullable Values

2009-03-27 Thread Will Shaver
Ack, of course epitka is right. Remember that nullable types are actually implemented with the backtick operator. Remember that this: ?int is actually this: System.Nullable``1[[System.Int32]] or something like that... -Will On Fri, Mar 27, 2009 at 2:00 PM, epitka wrote: > > I am not sure abou

[nhusers] Re: SCOPE_IDENTITY() sometimes returns incorrect value

2009-03-19 Thread Will Shaver
I'm using scope_identity while I develop because it is MUCH easier to debug. I plan to switch it over to GUIDs before deployment. (After running my tests and making sure nothing breaks. Not doing any ORDER BY ID calls, so everything should be fine. On Thu, Mar 19, 2009 at 7:50 AM, James Gregory

[nhusers] Re: SCOPE_IDENTITY() sometimes returns incorrect value

2009-03-19 Thread Will Shaver
Wow, that's a pretty epic fail. -Will On Thu, Mar 19, 2009 at 7:29 AM, Ayende Rahien wrote: > Should we add this to to docs? > Suggesting that while we support identity fully, we are not recommending it? > > On Thu, Mar 19, 2009 at 4:23 PM, Fabio Maulo wrote: >> >> >> https://connect.microsoft

[nhusers] Re: SchemaExport (no read, no write columns) (I know its nuts)

2009-03-17 Thread Will Shaver
So you want the column to be added to the database, but then for it not to be mapped in your C# file/ class? On Tue, Mar 17, 2009 at 1:27 PM, jeff.jarrell wrote: > > I have been using SchemaExport and SchemaUpdate to work with my > database (quite happily).  Now, I have to integrate with some >

[nhusers] Re: Execute custom sql for one property in NHibernate

2009-03-17 Thread Will Shaver
Or you can do this with interceptors / event handlers if you need logic like setting who it was updated by... On Mar 17, 2009 10:18 AM, "Fabio Maulo" wrote: property attributes generated="insert"generated="always" 2009/3/17 flatline > > > As I understand it NHibernate has a build in support

[nhusers] Re: nHibernate SetFirstResult & SetMaxResults Problems

2009-03-16 Thread Will Shaver
Can you paste the actual queries? What DB are you using? Is this on the trunk? On Mon, Mar 16, 2009 at 7:01 PM, Craig van Nieuwkerk wrote: > > I am using nHibernate and trying to implement some paging. If I run this code > >    IList list = session.CreateQuery("FROM Author").List(); > > it retur

[nhusers] Re: Order by DateTime? property

2009-03-10 Thread Will Shaver
If this is really important you could map a read only property on your entity with custom sql for that property. Do an ISNULL(prop,date(...)) etc. Clunky but it would work. On Mar 10, 2009 10:21 AM, "TigerShark" wrote: Well, as I'm no expert I don't know either, but I thought the dialect implem

[nhusers] Re: NHIbernate Property Formula bug?

2009-03-05 Thread Will Shaver
And by "bracket" he means ) On Thu, Mar 5, 2009 at 11:53 AM, James Gregory wrote: > I don't know if it's of any relevance, but your formula is either missing an > opening bracket, or has an extra closing one; the last bracket is unmatched. > > On Thu, Mar 5, 2009 at 4:56 PM, robcar wrote: >> >

[nhusers] Re: Min and Max date ranges

2009-03-02 Thread Will Shaver
http://www.primedigit.com/2008/12/02/sql-server-datetime-conversion/ Not explicitly an answer to your question, but I solved it for SQL server using the extension method here. On Mon, Mar 2, 2009 at 8:40 AM, sadiq.wa...@gmail.com wrote: > > I have soem classes that have dates as properties.  I

[nhusers] Re: Transforming data

2009-02-25 Thread Will Shaver
I would probably just pull all of the relavant sales objects with NH and then use some old fashioned foreach loops and linq to transform to your dto. You still pull all of your data in one query, and unless you're talking about 10k+ rows, c# is plenty fast for that data manipulation. On Feb 25, 20

[nhusers] Re: Many-To-Many relationship without using PK

2009-02-18 Thread Will Shaver
Can you explain a bit more? In an application that I'm working on, I had to map a one-to-many using a separate class as I wasn't able to modify the schema of a legacy database. [LegacyTable] StringID OtherData... [JoinerTable] ID LegacyStringID NonLegacyTableID [NonLegacyTable] ID The

[nhusers] Re: Many-to-many mapping with composite-id

2009-02-09 Thread Will Shaver
I'd recommend using two one-to-many relationships with a class in between. Annoying for modeling, but you can make the collections protected and publish public collections on your objects. public class Trips { public Trips() { ShipmentsOnTrip = new List(); } protected virtual IList Shipmen

[nhusers] Re: Delete business rules on soft delete

2009-02-05 Thread Will Shaver
Look in NHibernate Contrib \trunk\src\NHibernate.Burrow\src\NHibernate.Burrow.AppBlock\SoftDelete You can set up cascades for all of your objects, and then set a delete flag in an interceptor or event handler. On Thu, Feb 5, 2009 at 8:24 AM, Robin Nadeau wrote: > What about creating your own s

[nhusers] Re: TimeSpan and its RDBMS type

2009-02-05 Thread Will Shaver
Works for me, but I'm not using that type anywhere. On Wed, Feb 4, 2009 at 7:55 PM, Fabio Maulo wrote: > http://nhjira.koah.net/browse/NH-1657 > If somebody have a problem with the breaking change please let us know > here. > > -- > Fabio Maulo > > > > --~--~-~--~~~-

[nhusers] Re: Filter

2009-01-22 Thread Will Shaver
That will work, but won't let you turn it off dynamically. Best of luck. On Jan 22, 2009 11:58 AM, "Jake J. Kim" wrote: Thanks for your reply Will. I figured it out. I added [where="Active = 1"] attribute in the class mapping. On Jan 22, 9:06 am, W

[nhusers] Re: Setting ModifiedDate

2009-01-22 Thread Will Shaver
With the interceptor you can: public class MyInterceptor : EmptyInterceptor { public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types) { int md = FindProperty("ModifiedDate", propertyNames); if(md

[nhusers] Re: Filter

2009-01-22 Thread Will Shaver
http://knol.google.com/k/fabio-maulo/nhibernate-chapter-15/1nr4enxv3dpeq/18 Did you call session.EnableFilter("ActiveFilter") ? On Mon, Jan 19, 2009 at 4:54 PM, Jake J. Kim wrote: > > Hi all, > > I'm very new to NH, and looking for a way to filter out based on > property value. > For example,

[nhusers] Re: Is 1100 SQL request on startup something to be afraid of?

2009-01-20 Thread Will Shaver
It does seem like you've probably got some select N+1 going on here that could be cut down by some join fetching. Basically unless you have at least 1100 tables, having that many queries is probably not optimal. (Probably not even if you do have 1100 tables.) That said, if you're fine with a six se

[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 ver

[nhusers] Re: Self Join in Query

2009-01-13 Thread Will Shaver
Set where ResourceContext > = :resourceContext and r.ResourceSet = :resourceSet"); >query.SetString("resourceContext", > resource.ResourceContext); >query.SetEntity("resourceSet", resource.ResourceSet); >return query.List();

[nhusers] Re: Self Join in Query

2009-01-13 Thread Will Shaver
You're using a join constrain on your sql instead of a where constrain. Re-write your sql as something like:select r.* from Resource r where r.ResourceContext = (Select ResourceContext from Resource where ID = 1) Then re-write your criteria query in a similar fashion. ICriteria criteria = UnitOf

[nhusers] Re: Mapping one-to-one entities

2009-01-13 Thread Will Shaver
One-to-one is not advised for new database design, but is supplied for legacy databases. I am using one-to-one to map out the legacy databases that I have to deal with and it works fine. I recently fixed a bug so now one-to-one mapping with composite keys will work. -Will On Tue, Jan 13, 2009 at

[nhusers] Re: modify state in event listeners?

2008-12-23 Thread Will Shaver
I'm doing this in one of my applications with no problems. On Tue, Dec 23, 2008 at 6:00 PM, Tyler Burd wrote: > Can state be safely modified within an event listener or will that mess up > the executing flush? Are there any "gotchas"? Specifically, I would like > to set some properties on a ma

[nhusers] Re: Master / Detail Deletion

2008-12-23 Thread Will Shaver
apping. > > namespace="BaseEstate.Model.Entities" schema="BaseEstate" > assembly="BaseEstate.Model" default-lazy="false"> >table="Favourite" > > >type="string"> > > >

[nhusers] Re: Master / Detail Deletion

2008-12-23 Thread Will Shaver
Post your mapping for the Favourite class? It looks like you probably have a NOT NULL constraint on the foreign key mapping the Favourite to User. Do other collections reference the Favourite class? Sometimes all-delete-orphan doesn't work if the entity is not actually an orphan. -Will On Tue

[nhusers] Re: One Shot Insert on Indexed Collections NH3?

2008-12-22 Thread Will Shaver
And thanks much for not using Foo and Bar in your question! On Mon, Dec 22, 2008 at 12:36 AM, Wolfgang Trog wrote: > You need to put inverse="true" on the parent side and add a many-to-one > association on the picture side. Have a look at the doc: > > > > http://nhforge.org/doc/nh/en/index.html#

[nhusers] Re: Using GroupProperty

2008-12-19 Thread Will Shaver
dev list means? > > On Dec 19, 4:09 pm, "Will Shaver" wrote: > > I didn't figure that Alex was on the dev list. Lets see if he is > interested > > in tackling this first. > > Paging Alex > > > > On Fri, Dec 19, 2008 at 2:07 PM, Fabio Maulo

[nhusers] Re: Using GroupProperty

2008-12-19 Thread Will Shaver
I didn't figure that Alex was on the dev list. Lets see if he is interested in tackling this first. Paging Alex On Fri, Dec 19, 2008 at 2:07 PM, Fabio Maulo wrote: > 2008/12/19 Will Shaver > >> Well at some point each IProjection will need a boolean for IsSelected. It &g

[nhusers] Re: Using GroupProperty

2008-12-19 Thread Will Shaver
ook at the code, but doing it this way didn't > sound natural. > > > On Fri, Dec 19, 2008 at 11:51 PM, Will Shaver wrote: > >> Ok, if you want to add this functionality it shouldn't be that hard. >> Here's what you'll need to do: >> 1. Modify IPro

[nhusers] Re: Using GroupProperty

2008-12-19 Thread Will Shaver
my SELECT is > because I'm going to use it as a subquery (DetachedCriteria). I need a > single column SELECT so I could use the result of this subquery in the > IN statement of the main query. > > On Dec 19, 10:38 am, "Will Shaver" wrote: > > Why do you ne

[nhusers] Re: Using GroupProperty

2008-12-19 Thread Will Shaver
Why do you need to be rid of the group by column in your results? It should not adversely affect your query performance by a huge margin. The result order can be maintained through adding order by to the query. It may be possible to hack the source so as to add a GroupByButDontSelect() method of so

[nhusers] Re: Criteria Question: Foo links to collection of Bar and I only want most recent Bar

2008-12-18 Thread Will Shaver
Why can't you just get the most recent 'Bar' and then navigate to the parent foo in c#? session.CreateCriteria(typeof(Bar), "bar") .AddOrder(Order.Desc("bars.Added_On")) .SetMaxResult(1) If you need to restrict this to a certain ParentFood .Add(Restrictions.Eq("bar.ParentFood", foo)) Then y

[nhusers] Re: Question with Interceptor for Auditing.

2008-12-18 Thread Will Shaver
ure that casting takes cycles? I think it doesn't, because it is >> the cmpilers job to cast. >> >> On Thu, Dec 18, 2008 at 11:25 PM, Will Shaver wrote: >> >>> Yes, but with both Daniel and Tuna's examples are incomplete. >>> if (typeof(IAuditabl

[nhusers] Re: Question with Interceptor for Auditing.

2008-12-18 Thread Will Shaver
Yes, but with both Daniel and Tuna's examples are incomplete. if (typeof(IAuditableEntity).IsAssignableFrom(entity.GetType())) { ((IAuditableEntity) entity).Audit(); } or if (entity is IAuditableEntity) { ((IAuditableEntity) entity).Audit(); } In BOTH cases you have to do TWO casts. In mine you o

[nhusers] Re: Question with Interceptor for Auditing.

2008-12-18 Thread Will Shaver
If I understand your question, you want to know why you can't change your entity directly inside of the OnFlushDirty or OnSave overrides inside your Interceptor. If you review the code that calls the Interceptor you will understand this well enough, but I will explain briefly. Before the Intercepto

[nhusers] Re: Intercepting queries

2008-12-10 Thread Will Shaver
eleteEventListener that could be used on > retrieval, without having to specify it in the class mapping for each > class. I hadn't been able to find any, so I guess there isn't. > > Thanks, > Matt > > On Dec 9, 4:18 pm, "Will Shaver" <[EMAIL PROTECTED]>

[nhusers] Re: Intercepting queries

2008-12-09 Thread Will Shaver
Important to note that filters don't work when doing a get() or load() with an ID directly. On Tue, Dec 9, 2008 at 6:13 AM, Fabio Maulo <[EMAIL PROTECTED]> wrote: > http://nhforge.org/doc/nh/en/index.html#objectstate-filters > > 2008/12/9 mattcole <[EMAIL PROTECTED]> > >> >> Hi, >> >> We are look

[nhusers] Re: Prevent eager fetching on CreateAlias

2008-12-08 Thread Will Shaver
If you want to specify it in the where clause without including it in a join, have NH perform a subquery using DetachedCriteria. On Mon, Dec 8, 2008 at 3:53 PM, Jesse <[EMAIL PROTECTED]> wrote: > > Does anybody know how to prevent eager fetching when using CreateAlias > with the criteria api? I j

[nhusers] Re: If integration tests pass on SQLite means they will always pass on MS SQL Server too?

2008-12-02 Thread Will Shaver
Thanks! On Dec 2, 2008 9:26 AM, "Fabio Maulo" <[EMAIL PROTECTED]> wrote: 2008/12/2 Will Shaver <[EMAIL PROTECTED]> > > I just (as in right now) wrote a big post on dealing with DateTime conversion for SQL Server. M... Will take a look on how use if you often

[nhusers] Re: If integration tests pass on SQLite means they will always pass on MS SQL Server too?

2008-12-02 Thread Will Shaver
I just (as in right now) wrote a big post on dealing with DateTime conversion for SQL Server. Moderately relavant to this discussion. http://www.primedigit.com/2008/12/02/sql-server-datetime-conversion/ -Will On Tue, Dec 2, 2008 at 8:10 AM, Stefan Steinegger <[EMAIL PROTECTED]>wrote: > > For

[nhusers] Re: Entities behavior injection

2008-11-26 Thread Will Shaver
Not sure if he'll like those... On Wed, Nov 26, 2008 at 9:43 AM, Lee Henson <[EMAIL PROTECTED]> wrote: > Fabio, I am sending you big man-hugs right now. > > 2008/11/26 Fabio Maulo <[EMAIL PROTECTED]> >> >> As promised to Lee >> http://fabiomaulo.blogspot.com/2008/11/entities-behavior-injection.ht

[nhusers] Re: not-null property references a null or transient value - and questions about NHibernate UOW

2008-11-26 Thread Will Shaver
It looks like you're using Guid.Comb from the mapping you provided. This is good, as it should help prevent these sorts of problems. What flush mode are you using? On Wed, Nov 26, 2008 at 4:52 AM, Graham Bunce <[EMAIL PROTECTED]> wrote: > > This problem is driving me up the wall and I can't see

[nhusers] Re: API documentation for NH 2.0

2008-11-17 Thread Will Shaver
A few weeks back I worked on taking the existing docs in the trunk of the source and porting them into the wiki. I got hung up on style sheet related issues that still need resolving. We need some style sheets set up on the site (nhforge) for things like codeblocks, inline code, xml etc. I'm still

[nhusers] Re: Updating many-to-one relationship references

2008-11-03 Thread Will Shaver
If you use Load it won't hit the database until it actually needs it. Does that not work in this situation? On Mon, Nov 3, 2008 at 4:00 AM, paulh <[EMAIL PROTECTED]> wrote: > Jonty > > Could you give us some more information, e.g. what your domain model is and > what the mapping looks like - with

[nhusers] Re: NHibernate query

2008-11-03 Thread Will Shaver
Another option would be to create a view with the status field selected via subquery, then map db reads to that view and db writes to the table. A bit more complicated in the mapping but might be easier in the domain. On Nov 2, 2008 6:31 AM, "Ken Egozi" <[EMAIL PROTECTED]> wrote: I wanted to

[nhusers] Re: Pick Up only days

2008-10-28 Thread Will Shaver
FF(day, 0, > orderedDate), 0)" type="Int32" /> > just another question how can I set read only in the mapping property ? > cheers > > > > 2008/10/28 Will Shaver <[EMAIL PROTECTED]> > >> >> The easiest way that comes to mind would be to map a read

[nhusers] Re: Pick Up only days

2008-10-28 Thread Will Shaver
The easiest way that comes to mind would be to map a read-only property to a sql conversion Convert('dd', OrderDate) The Convert('dd' OrderDate) might vary depending on your backing db. You could then reference OrderDay in your criteria queries. On Tue, Oct 28, 2008 at 3:40 PM, Mauro <[EMAIL

[nhusers] Re: NHibernate Filter via Get/Criteria/Hql

2008-10-28 Thread Will Shaver
e enabled for a > > collection) only when you use explicit joins or, more general, when the > > QuerySpace of a filter match with the QuerySpace of a query. > > > > 2008/9/10 Will Shaver <[EMAIL PROTECTED]> > > > > > > > > > Noticing some incon

[nhusers] Re: Mapping bool fields in Oracle

2008-10-27 Thread Will Shaver
Read documentation for IUserType should map well enough, ping back if need more detail Sent from g1 On Oct 27, 2008 9:21 PM, "Craig van Nieuwkerk" <[EMAIL PROTECTED]> wrote: I have an Oracle database and the bool fields are all CHAR(1) with Y/N for boolean fields. How should I map this to a

[nhusers] Re: When is the save actually done?

2008-10-27 Thread Will Shaver
What platform for web are you using? I'd look into ATM http://www.castleproject.org/container/facilities/trunk/atm/index.html There are plenty of discussions about it in this group if you search the archives. On Mon, Oct 27, 2008 at 1:13 PM, Berke <[EMAIL PROTECTED]> wrote: > > That all depend

[nhusers] Re: many-to-many association table clean up

2008-10-27 Thread Will Shaver
Most likely you'll need to create a separate mapping object instead of relying on the built in many-to-many table. (I don't have much experience with the many-to-many mapping as I always seem to have other columns that I need.) If you do something like: Artefact <--> ArtefactAccess <--> Role The

[nhusers] Re: Calling constructor that performs guard checks - immutable types

2008-10-25 Thread Will Shaver
I believe this has been discussed in the past, please search the group archives. While I believe there are solutions involving custom object loaders, why would you have an invalid object in your database? On Oct 25, 2008 4:17 AM, "Fabio Maulo" <[EMAIL PROTECTED]> wrote: Repeated request.Our f

[nhusers] Re: Found shared references to a collection

2008-10-23 Thread Will Shaver
Death to foo and bar! http://www.primedigit.com/2008/08/05/death-to-foo-and-bar ;-) On Thu, Oct 23, 2008 at 4:00 PM, Jan Limpens <[EMAIL PROTECTED]> wrote: > > That's the problem with foobar code. It tends to oversimplify code (I > tend to :)) > Categories is virtual in Article and overridden i

[nhusers] Re: Lazy Loading but from a different place

2008-10-23 Thread Will Shaver
Do you need to update the OrderItems? If not, you could use a view. I've used this successfully to merge a database I could write to with one I could not. You can map hbm files to views, just specify the view name as the "table". On Thu, Oct 23, 2008 at 11:41 AM, Tim Barcz <[EMAIL PROTECTED]>

[nhusers] Re: When is IFlushEntityEventListener called

2008-10-22 Thread Will Shaver
Thanks for the recognition! I was just getting my work done. :) All of my patches have been things that I needed at the time. I don't have tons of free time to dedicate to the project, but I figure that if lots of people submitted patches for things that they needed fixed, we'd move forward quickly

[nhusers] Re: Unit of Work Pattern

2008-10-20 Thread Will Shaver
ATM and Microsoft's new ASP.Net don't play nicely when you get parameter binders involved, so I've added something to MvcContrib for this as well. Still being evaluated here: http://www.codeplex.com/MVCContrib/SourceControl/PatchList.aspx On Mon, Oct 20, 2008 at 3:06 PM, Ken Egozi <[EMAIL PROTE

[nhusers] Re: FetchMode.Eager ignored

2008-10-19 Thread Will Shaver
Perhaps a bit more of the data model / mappings would be helpful here... On Sun, Oct 19, 2008 at 3:09 PM, joe <[EMAIL PROTECTED]> wrote: > > Same result. > > On Oct 18, 2:03 am, "Will Shaver" <[EMAIL PROTECTED]> wrote: >> Try .SetFetchMode(relation, FetchM

[nhusers] Re: Intercepting Lazy Loading

2008-10-19 Thread Will Shaver
I don't think the goal of this thing is to leave it running when you deploy your app! Just turn it on when you're trying to zero in on a problem. On Sun, Oct 19, 2008 at 11:05 AM, Dag <[EMAIL PROTECTED]> wrote: > > That solution was a bit scary, I hope there's better ways than hooking > into log4

[nhusers] Re: FetchMode.Eager ignored

2008-10-17 Thread Will Shaver
Try .SetFetchMode(relation, FetchMode.Join); instead of Eager. On Thu, Oct 16, 2008 at 8:25 PM, joe <[EMAIL PROTECTED]> wrote: > > Hi. > > I am trying to use the criteria API to eager fetch a many to one > property. > > ICriteria criteria = > NHibernateSession.CreateCriteria(typeof(Customer)).Ad

[nhusers] Re: Success stories using NH

2008-10-13 Thread Will Shaver
Have root on the backend db? You could always null out the column with the actual revision content. On Mon, Oct 13, 2008 at 11:46 AM, Fabio Maulo <[EMAIL PROTECTED]> wrote: > unfortunately is an open issue in CommunityServer > > 2008/10/13 Tuna Toksöz <[EMAIL PROTECTED]> > >> Can we delete the r

[nhusers] Re: Topics for blog posts

2008-10-13 Thread Will Shaver
Any word on a css style that we can use across all wiki pages for code? I'd really like to post the docbook stuff. On Sun, Oct 12, 2008 at 3:28 PM, Fabio Maulo <[EMAIL PROTECTED]> wrote: > 2008/10/12 Tuna Toksöz <[EMAIL PROTECTED]> > >> and your English is good! >> > > This is only because the

[nhusers] Re: Auditing Deletes

2008-10-13 Thread Will Shaver
t; a save or an update when the SaveOrUpdate event fires? > > On Oct 10, 6:28 pm, "Will Shaver" <[EMAIL PROTECTED]> wrote: > > I just double-checked and I am getting my event listener to pick up > > both parent and children for my domain. > > > > Be sure

[nhusers] Re: Auditing Deletes

2008-10-10 Thread Will Shaver
EventListener doesn't then seem to fire when the save cascades down > into class B. > > Do you have any ideas? > > Thanks, > > > Mark > > On 6 Oct, 16:06, "Will Shaver" <[EMAIL PROTECTED]> wrote: >> Could you set a "DeleteMe" column

[nhusers] Re: Lazy loading and referring to private class members. By field or property accessor?

2008-10-08 Thread Will Shaver
http://www.nhforge.org/doc/nh/en/index.html 5.1.9. property wrote: > 2008/10/8 MAMMON <[EMAIL PROTECTED]> >> >> One other question -- let's say I want some property in my data access >> layer to be read-only for consumers of the DAL. Do I need to have >> setters on my properties for NH to work

[nhusers] Re: Lazy loading and referring to private class members. By field or property accessor?

2008-10-08 Thread Will Shaver
Hopefully someone else will correct me if I'm wrong here: #0 - This could be easily confirmed with some unit tests #1 - This depends on your mapping. If you are using private member vars, then map to your vars. If you map to the property, reference the property and don't use member vars. #3. You

[nhusers] Re: Accessing the set of objects about to be flushed.

2008-10-07 Thread Will Shaver
Listeners are fairly easy to implement. Probably you want to do this by overloading the DefaultSaveEventListener class AuditableSaveEventListener : DefaultSaveEventListener { protected override object PerformSaveOrUpdate(SaveOrUpdateEvent @event) { IAuditable entity = @event.Entity as IAudita

[nhusers] Re: Beware Non-Deterministic Sort

2008-10-07 Thread Will Shaver
d > there's a lot to learn from this book about the way query plans works in SQL > Server, and on query tuning etc. > > link to the book (highly recommended read): > http://astore.amazon.com/kenegoziswebl-20/detail/0735623139 > > > > > > On Tue, Oct 7, 2008 at

[nhusers] Re: Beware Non-Deterministic Sort

2008-10-07 Thread Will Shaver
will > solve the determinism problem, ensuring the same exact results. > > > On Mon, Oct 6, 2008 at 9:04 PM, Ayende Rahien <[EMAIL PROTECTED]> wrote: > >> I think that this is an issue with SQL Server if you are doing sorts on >> multi proc machine. Can you give mor

[nhusers] Beware Non-Deterministic Sort

2008-10-06 Thread Will Shaver
Here's two days of my life solved that was solved with by adding a single line to my project. I'm posting it here for the benefit of others. It's an odd enough case that I don't know that it should go into a FAQ. It appears as though for some queries involving sql server 2005 and ROW_NUMBER() the

[nhusers] Re: Auditing Deletes

2008-10-06 Thread Will Shaver
Could you set a "DeleteMe" column and have the triggers watch for that and then delete the row? The problem is that once you delete something with NH, the entity is no longer persistant, so changes to it are not sent to the db. On Mon, Oct 6, 2008 at 5:38 AM, Oz <[EMAIL PROTECTED]> wrote: > >

[nhusers] one-to-many bidirectional mapping with IList

2008-10-01 Thread Will Shaver
So there is this wonderfully clear sentenece in the current (1.2) documentation: "Please note that NHibernate does not support bidirectional one-to-many associations with an indexed collection (list, map or array) as the "many" end, you have to use a set or bag mapping. " Here's what I'm trying

[nhusers] Re: Can I store arbitrary objects in ISession? By key, in some kind of bag or dictionary?

2008-09-26 Thread Will Shaver
Don't know about storing an arbitrary set of data in an ISession... but why not do this: IDictionary executingUsers = new Dictionary(); ... Just be sure to pull them out when you close the sessions... On Fri, Sep 26, 2008 at 4:58 PM, MAMMON <[EMAIL PROTECTED]> wrote: > > In ASP.NET

[nhusers] Re: SQL Server 2008 dialect for NHibernate?

2008-09-26 Thread Will Shaver
A good place to start would be with a list of specific dialect features that you think need to be incorporated. For example, with sql2005 the new method of paging was implemented. What's special in 2008 that NH should take advantage of? On Fri, Sep 26, 2008 at 1:19 PM, James Nail <[EMAIL PROTECTED

[nhusers] Re: Is it possible to speed up the loading of an entire data tree?

2008-09-23 Thread Will Shaver
Not using session.Get(), use HQL or Criteria instead. For example: public static IList GetAll(this ISession session) { return session.CreateCriteria(typeof (T)).List(); } ... IList products = session.GetAll(); Do that first (with whatever entity type you are doing this operation on) and the

[nhusers] Re: Is it possible to speed up the loading of an entire data tree?

2008-09-22 Thread Will Shaver
If you know that you're going to need to serialize ALL of the children of a graph, you could session.Get() all levels of the graph at the start of the call. NH will then link the entities up for you and avoid return trips to the DB. Unless your entities are HUGE (blob size binary data) then genera

[nhusers] Re: Filter alias/relation based on concrete class

2008-09-16 Thread Will Shaver
I don't know how this is supposed to be solved (and would love to know myself) but ended up mapping the class type column as a property in my class thereby allowing me to access it via HQL/Criteria. On Tue, Sep 16, 2008 at 8:12 AM, Matt <[EMAIL PROTECTED]> wrote: > > Using NHibernate 2.0, how can

[nhusers] Re: PDF Library for use with NHibernate?

2008-09-12 Thread Will Shaver
ep 12, 2008 at 9:11 AM, Victor Kornov <[EMAIL PROTECTED]> wrote: > Just curious, how pdf is related to NH (orm) & MVC (web)? > > On Fri, Sep 12, 2008 at 8:07 PM, Will Shaver <[EMAIL PROTECTED]>wrote: > >> Anyone have a recommendation for a PDF library for use with

[nhusers] PDF Library for use with NHibernate?

2008-09-12 Thread Will Shaver
Anyone have a recommendation for a PDF library for use with NH and ASP.NETMVC? Of course a permissive open source license is best. :) -Will --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post

[nhusers] Re: DeleteEventListener

2008-09-11 Thread Will Shaver
re-inserting) > > > > > On 10 sep, 23:41, Patrick De Boeck <[EMAIL PROTECTED]> wrote: > > > > yep. Can't find any refernce on this. > > > > > > I was thinking about a generic way of removing all objects from my > > > > versiona

[nhusers] Re: DeleteEventListener

2008-09-10 Thread Will Shaver
e softdeletable, but the orderline would not! > > Thus when I remove my order that will be set to "IsDeleted = true", > while my orderlines would actually be deleted immediately! > > This leads to resaving a deleted orderline ! > > > On 10 sep, 18:37,

[nhusers] NHibernate Filter via Get/Criteria/Hql

2008-09-10 Thread Will Shaver
Noticing some inconsistancies with object loading, and was wondering if any of you knew if this was expected behavior or a bug. I've included a patch for DynamicFilterTest.cs in the FilterTest folder of the nhibernate tests, but basically it's like this: Filters don't seem to work on the primary

[nhusers] Re: DeleteEventListener

2008-09-10 Thread Will Shaver
http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/04/08/soft-deletes.aspx There is also some code in the NHibernate Contrib project under NHibernate.Burrow.Appblock.SoftDelete that you can review or use. -Will On Wed, Sep 10, 2008 at 4:06 AM, Patrick De Boeck <[EMAIL PROTECTED]>wrote:

[nhusers] Still can't get inheritance right

2008-09-09 Thread Will Shaver
I've asked similar questions in the past but haven't gotten any concrete answers, and I'm hitting this over and over. I've tried a ton of different options, and would be willing to create a separate solution to show others what the problem is. Last time I asked it as doughnut classes and we got off

[nhusers] Re: Is NHibernate.Caches.SysCache working?

2008-09-09 Thread Will Shaver
I do this in my custom interceptor: public class CustomInterceptor : EmptyInterceptor { private ISession session; public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types) { if (session.Transaction == null |