[nhusers] Re: Method for unproxying by call to virtual base class method no longer works

2011-11-08 Thread acl123
in NHibernate 3.2.0.GA (retested it just now). But why does it write Castle.DogProxy? Are you still using Castle with NHibernate 3? Using the internal proxy factory it would write AnimalProxy. On 8 Nov., 06:42, acl123 andrewclawre...@gmail.com wrote: In NHibernate 2 we used to be able to force

[nhusers] Re: NotSupportedException when using Take

2011-11-07 Thread acl123
)    .OrderBy(x = x.Name)    .ThenBy(x = x.Code)    .Take(5)    .ToList(); A. On 4 Lis, 04:41, acl123 andrewclawre...@gmail.com wrote: Hi, I'm upgrading from NHibernate 2.1.2 to 3.2.0. We were using a the Linq provider a lot so I am making converting to the new built-in Linq

[nhusers] NotSupportedException when using Take

2011-11-03 Thread acl123
Hi, I'm upgrading from NHibernate 2.1.2 to 3.2.0. We were using a the Linq provider a lot so I am making converting to the new built-in Linq provider. The following query is throwing a not supported exception: Session.QueryFoo() .Where(x = x.Code == testcode) .Where(x = x.Bar.Id = 7)

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

2010-08-03 Thread acl123
Yes On Jul 22, 4:52 am, epitka exptrade2...@yahoo.com wrote: Are you using any custom event listeners, maybe for auditing? On Jul 20, 9:06 pm,acl123andrewclawre...@gmail.com wrote: I am still really struggling with this

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

2010-07-20 Thread acl123
I am still really struggling with this error: http://groups.google.com/group/nhusers/browse_thread/thread/1db7fd843b0b4b56/df46cb0a150acd47 I have quite literally tried everything to get rid of it, but I can't. The exception is very difficult to reproduce and only appears in our exception logs

[nhusers] Joined entity still being eagerly selected

2010-05-07 Thread acl123
I have a query which is something like this: Session.CreateSQLQuery( @SELECT f.*, b.*, z.* FROM Foo f LEFT OUTER JOIN Bar b ON b.Id = f.BarId LEFT OUTER JOIN Zar z ON z.Id = b.ZarId ) .AddEntity(f, typeof(Foo)) .AddJoin(b, f.BarId) .AddJoin(z, f.ZarId)

[nhusers] How does second level caching of many-to-many and one-to-many collections work?

2010-04-07 Thread acl123
I have the following situation: public OfficeDbMap() { ... HasMany(x = x.Employees) .Cache.NonStrictReadWrite(); } What I notice is that if the Employee is deleted, the cache of Office- Employee relationships does not become invalidated, causing all types of trouble. How can I

[nhusers] Re: Criteria Queries: Problems with sub-queries

2010-03-04 Thread acl123
I have exactly the same problem here. On Feb 17, 1:05 am, Fabio Maulo fabioma...@gmail.com wrote: AFIR there isn't BR in Criteria API since 1.2.0 - 2.0.0 2010/2/16 Gabriel Schenker gnschen...@gmail.com Fabio, do you know of any breaking changes in the criteria query api between release

[nhusers] Using access=noop causes collection to be deleted

2010-03-01 Thread acl123
I am using access=noop to try and create a query-only set, like this: set access=noop name=Bars table=FooBarManyToManyRelationshipTable key column=FooId / many-to-many class=MyProject.Bar column name=BarId /

[nhusers] Bug with Projections.Conditional

2010-02-14 Thread acl123
I am running Nhibernate 2.1.2.4 and am encountering an issue which was supposedly fixed last year. The bug relates to the use of Projections.Conditional combined with Projections.Constant and Restrictions.Eq. The issue is described well here:

[nhusers] Re: Help tracking down error: deleted object would be re-saved by cascade

2010-02-08 Thread acl123
at 12:44 AM, acl123 andrewclawre...@gmail.com wrote: This error has been popping up frequently in my logs: deleted object would be re-saved by cascade I have had no luck in replicating it however. As far as I know, I am never deleting an object of the specified type and neither am I assigning

[nhusers] Help tracking down error: deleted object would be re-saved by cascade

2010-02-07 Thread acl123
This error has been popping up frequently in my logs: deleted object would be re-saved by cascade I have had no luck in replicating it however. As far as I know, I am never deleting an object of the specified type and neither am I assigning the object to two different collections or references.

[nhusers] Problem with audit event listeners

2010-01-03 Thread acl123
I am using Ayende's audit event listeners, so that on pre-update and pre-insert, the insert/update dates are tracked (http://ayende.com/ Blog/archive/2009/04/29/nhibernate-ipreupdateeventlistener-amp- ipreinserteventlistener.aspx) The problem I am having is in the case that an entity is inserted,

[nhusers] NullReferenceException in EvictCollection

2009-12-15 Thread acl123
I am getting a NullReferenceException when evicting an object: System.NullReferenceException: Object reference not set to an instance of an object. at NHibernate.Event.Default.EvictVisitor.EvictCollection (IPersistentCollection collection) at

[nhusers] collection [Foo.Bars] was not processed by flush()

2009-12-14 Thread acl123
I am receiving the following error: [AssertionFailure: collection [Foo.Bars] was not processed by flush()] NHibernate.Engine.CollectionEntry.PostFlush(IPersistentCollection collection) +163 NHibernate.Event.Default.AbstractFlushingEventListener.PostFlush (ISessionImplementor session) +516

[nhusers] NHibernate SetFetchMode to cause eager selects

2009-12-14 Thread acl123
I am trying to eagerly fetch collections using selects, but all I am getting is *inner* joins. What is going on? Session.CreateCriteria(typeof(Foo)) .SetFetchMode(Bars, FetchMode.Select) .CreateAlias(Bars, b) .SetFetchMode(b.Bazes, FetchMode.Select); I have tried

[nhusers] Re: collection [Foo.Bars] was not processed by flush()

2009-12-14 Thread acl123
in event listeners?  I would get this error if I was doing a lazy load in a pre/post insert/update event.  I have a hack to get around this but I wouldn't say it is a best practice. On Dec 14, 9:31 pm, acl123 andrewclawre...@gmail.com wrote: I am receiving the following error: [AssertionFailure

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

2009-12-14 Thread acl123
Exactly the same problem here :) On Dec 3, 8:05 pm, Revin rs_h...@hotmail.com wrote: Hi epitka, Do you have any luck with this problem? I got the same error message... Thanks... -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this

[nhusers] Setting a reference property prior to insert

2009-12-14 Thread acl123
There are cases where one needs to set a default for an entity's property, prior to the entity being inserted, but not when the entity is first constructed. The a pre-insert event-listener would seem to be the proper place to do this, but there seems to be a problem with doing this if the event

[nhusers] Caching of non-lazy-loaded, fetch-select references

2009-12-13 Thread acl123
If 2nd-level caching is enabled, is it possible for collections mapped as eagerly fetch-select to be cached. I'm surprised that this doesn't seem to be possible without manually constructing a query. -- You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] Re: The value is not of type System.Nullable`1[Money]...

2009-11-30 Thread acl123
:32 pm, Fabio Maulo fabioma...@gmail.com wrote: Without mappings and classes we can't say where is the bug. Too much mysteries... starting from NullableDecimalProperty 2009/11/29 acl123 andrewclawre...@gmail.com Similar bug, this time without the custom user type

[nhusers] The value is not of type System.Nullable`1[Money]...

2009-11-29 Thread acl123
Running the following NHibernate Linq query: Session.LinqMyEntity.Select(x = x.NullableMoneyProperty).FirstOrDefault(); I receive the following exception: NHibernate.Exceptions.GenericADOException: Unable to perform find[SQL: SQL not available] ---

[nhusers] Re: The value is not of type System.Nullable`1[Money]...

2009-11-29 Thread acl123
Similar bug, this time without the custom user type: Session.CreateCriteriaMyEntity() .SetProjection(LambdaProjection.MinMyEntity(x = x.NullableDecimalProperty)) .FutureValuedecimal?(); Results in the exception: System.ArgumentException: The value is not of type

[nhusers] Problem with caching and selecting multiple fields with linq

2009-11-16 Thread acl123
I have the following query: Session.LinqFooBar() .SetCachable(true) .SetCacheRegion(foobar) .Select(x = new Baz(x.Foo, x.Bar)) .ToList(); This works when caching is turned off, but with caching enabled I receive the following exception: System.InvalidCastException: Unable to

[nhusers] Re: More unexpected transactionscope behaviour

2009-10-22 Thread acl123
NHibernate breaks when using nested transactions though, so I'm kind of stuck. 2009/10/19 acl123 andrewclawre...@gmail.com By the way I am using Session-Per-Web-Request as this appears to be the recommend way to use NHibernate with Asp .NET. This means that I definitely don't want

[nhusers] Re: More unexpected transactionscope behaviour

2009-10-22 Thread acl123
23, 12:26 pm, acl123 andrewclawre...@gmail.com wrote: Hi Fabio, The issue is that the second transaction is committed, even though I never call transaction.commit. On Oct 20, 1:43 pm, Fabio Maulo fabioma...@gmail.com wrote: Personally I don't know what you are talking about.You can have x

[nhusers] Re: Transaction not rolling back - who's bug is this?

2009-10-19 Thread acl123
Ok thanks, my bigger problem is here: http://groups.google.com/group/nhusers/browse_thread/thread/64d608afc2cd01c3 On Oct 19, 4:23 pm, Fabio Maulo fabioma...@gmail.com wrote: your are calling Flush 2009/10/18 acl123 andrewclawre...@gmail.com The following code demonstrates a misleading

[nhusers] Re: More unexpected transactionscope behaviour

2009-10-19 Thread acl123
you would use an NHibernate transaction - i.e. multiple transaction per session. Clearly NHibernate breaks when using nested transactions though, so I'm kind of stuck. On Oct 19, 12:59 pm, acl123 andrewclawre...@gmail.com wrote: In this case, the second ADO command is committed to the database

[nhusers] Re: How to set default value of a property?

2009-10-18 Thread acl123
If you are automatically generating your database from your NHibernate config files, then this sort of thing is necessary. I'm not sure if there are other benefits... On Oct 15, 12:24 am, mynkow myn...@gmail.com wrote: 10xacl123, but why NHib has such an option then? What is the real purpose

[nhusers] Transaction not rolling back - who's bug is this?

2009-10-18 Thread acl123
The following code demonstrates a misleading situation in which data is committed to the database, even though commit is never called on a transaction. Could anyone explain why? [TestFixture] public class TestFixture { [Test] public void Test() {

[nhusers] More unexpected transactionscope behaviour

2009-10-18 Thread acl123
In this case, the second ADO command is committed to the database, whilst the first is rolled back. What is going on? This seems very weird to me. This is kind of a follow up question to my previous post here: http://groups.google.com/group/nhusers/browse_thread/thread/241cc04309744321

[nhusers] Re: How to set default value of a property?

2009-10-14 Thread acl123
You can do it in the mapping like this: property name=SomeProperty column default=myValue / /property Be aware that this doesn't actually create default values for your C# objects. You will need to still do that the traditional way: public class MyEntity { private string _someProperty

[nhusers] Many-to-many using non-primary-key, but unique, column

2009-10-08 Thread acl123
Hi, Is it possible to map the following legacy table structure? table Foo { Id (PK), Code (Unique), } table Bar { Id (PK) } table FooBars { FooCode, BarId } The entity class would look like this: class Foo { public virtual Guid Id { get; set; } public virtual string Code { get; set;

[nhusers] NHibernate sometimes dies on startup

2009-09-23 Thread acl123
Hi, I am running a Web Forms app on IIS 7 (Classic Mode). I have recently deployed some code using NHibernate and it was running fine in the live environment for about 4 days. Then, overnight, the application pool restarted. When it started up, NHibernate failed to initialize and my website was

[nhusers] NHibernate first level cache not working with TransactionScope

2009-09-23 Thread acl123
I am trying to get the following unit test to succeed: using (var transaction = new TransactionScope()) using (var connection = new ConnectionScope()) // Alez Acheson's implementation { var foo = NHSessionManager.CurrentSession.LinqFoo