I have SP1.  Not sure what tests you're running, can you send them?  Are you
able to get the following code to run in a test?

using (ISession session = NHibernateHelper.OpenSession())
            {
                DateTime d = DateTime.Now;
               List<PickPeriod> periods =
session.Linq<PickPeriod>().Where(pp => pp.StartDate < d).ToList();
            }

I'm not having any trouble w/ INSERTs, so I don't think the issue you
pointed out is the problem.

On Sat, Mar 7, 2009 at 12:02 PM, Tuna Toksoz <[email protected]> wrote:

> Because all tests are passing, except the two with the following error
>
>
> NHibernate: INSERT INTO pool_PickPeriods (StartDate, EndDate, 
> LastGoodFeedDate, FeedLockInDate, Name, SeasonID) VALUES (@p0, @p1, @p2, @p3, 
> @p4, @p5); select SCOPE_IDENTITY(); @p0 = '3/7/2009 8:01:09 PM', @p1 = 
> '3/14/2009 8:01:09 PM', @p2 = '1/1/1900 12:00:00 AM', @p3 = '3/7/2009 8:01:09 
> PM', @p4 = 'week1', @p5 = '2007'
>
> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the 
> FOREIGN KEY constraint "FK_pool_PickPeriods_pool_Seasons". The conflict 
> occurred in database "MvcTest", table "dbo.pool_Seasons", column 'SeasonID'.
> The statement has been terminated.
>
>
>
> Tuna Toksöz
> http://tunatoksoz.com
> http://turkiyealt.net
> http://twitter.com/tehlike
>
> Typos included to enhance the readers attention!
>
>
>
> On Sat, Mar 7, 2009 at 8:01 PM, Tuna Toksoz <[email protected]> wrote:
>
>> dO you have SP1 installed? it could be the reason.
>>
>> Tuna Toksöz
>> http://tunatoksoz.com
>> http://turkiyealt.net
>> http://twitter.com/tehlike
>>
>> Typos included to enhance the readers attention!
>>
>>
>>
>> On Sat, Mar 7, 2009 at 7:51 PM, Randy McCluer <[email protected]> wrote:
>>
>>> Here's the sample.  I rolled everything into the MVC app and the sample
>>> call is in the index action on the Home controller.  Hope this helps as I
>>> really love the linq side of this!
>>>
>>>
>>> On Sat, Mar 7, 2009 at 11:39 AM, Randy <[email protected]> wrote:
>>>
>>>>
>>>> Sorry, wasn't tracking via email.  Dummy reply to get it to my inbox.
>>>>
>>>> On Mar 7, 11:31 am, Tuna Toksoz <[email protected]> wrote:
>>>> > Just send it as an attachment in your mail
>>>> >
>>>> > Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://
>>>> twitter.com/tehlike
>>>> >
>>>> > Typos included to enhance the readers attention!
>>>> >
>>>> > On Sat, Mar 7, 2009 at 7:30 PM, Randy <[email protected]> wrote:
>>>> >
>>>> > > Nothing to do w/ DateTime, it happens for any query w/ any data
>>>> type.
>>>> > > Trying to pare the project down to something meaningful, but how do
>>>> I
>>>> > > attach it here?
>>>> >
>>>> > > On Mar 7, 11:00 am, Tuna Toksoz <[email protected]> wrote:
>>>> > > > Can yo add the test project? I guess I know the problem.
>>>> >
>>>> > > > The problem can be the use of DateTime
>>>> >
>>>> > > > Try
>>>> >
>>>> > > > var date=DateTime.Now;
>>>> > > > List<PickPeriod> periods = session.Linq<PickPeriod>
>>>> > > > ().Where(pp => pp.StartDate < date).ToList();
>>>> >
>>>> > > > Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://
>>>> > > twitter.com/tehlike
>>>> >
>>>> > > > Typos included to enhance the readers attention!
>>>> >
>>>> > > > On Sat, Mar 7, 2009 at 6:55 PM, Randy <[email protected]> wrote:
>>>> >
>>>> > > > > Started over with the simplest configuration I could manage and
>>>> still
>>>> > > > > having this problem.  Is there any configuration necessary for
>>>> > > > > enabling NHibernate.Linq functionality that I may be missing?
>>>> >
>>>> > > > > I am making a simple call:
>>>> > > > > using (ISession session = NHibernateHelper.OpenSession())
>>>> > > > >            {
>>>> > > > >               List<PickPeriod> periods =
>>>> session.Linq<PickPeriod>
>>>> > > > > ().Where(pp => pp.StartDate < DateTime.Now).ToList();
>>>> > > > >            }
>>>> >
>>>> > > > > Here's the stack trace for the exception:
>>>> >
>>>> > > > > [MappingException: No persister for: System.DateTime]
>>>> > > > >   NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String
>>>> > > > > entityName) +144
>>>> > > > >
>>>> NHibernate.Linq.Visitors.AssociationRewriteVisitor.VisitMemberAccess
>>>> > > > > (MemberExpression expr) in
>>>> E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\AssociationRewriteVisitor.cs:53
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in
>>>> E:\code
>>>> > > > >
>>>> \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs:
>>>> > > > > 66
>>>> > > > >   NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit
>>>> > > > > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.VisitBinary(BinaryExpression
>>>> b)
>>>> > > > > in E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq
>>>> > > > > \ExpressionVisitor.cs:124
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in
>>>> E:\code
>>>> > > > >
>>>> \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs:
>>>> > > > > 56
>>>> > > > >   NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit
>>>> > > > > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.VisitLambda(LambdaExpression
>>>> > > > > lambda) in
>>>> E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq
>>>> > > > > \ExpressionVisitor.cs:313
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in
>>>> E:\code
>>>> > > > >
>>>> \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs:
>>>> > > > > 70
>>>> > > > >   NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit
>>>> > > > > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.VisitUnary(UnaryExpression
>>>> u) in
>>>> > > > > E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq
>>>> > > > > \ExpressionVisitor.cs:114
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in
>>>> E:\code
>>>> > > > >
>>>> \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs:
>>>> > > > > 32
>>>> > > > >   NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit
>>>> > > > > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33
>>>> > > > >
>>>> NHibernate.Linq.ExpressionVisitor.VisitList(ReadOnlyCollection`1
>>>> > > > > original) in
>>>> E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq
>>>> > > > > \ExpressionVisitor.cs:200
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.VisitMethodCall
>>>> > > > > (MethodCallExpression m) in
>>>> E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\ExpressionVisitor.cs:185
>>>> > > > >   NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in
>>>> E:\code
>>>> > > > >
>>>> \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs:
>>>> > > > > 68
>>>> > > > >   NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit
>>>> > > > > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src
>>>> > > > > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33
>>>> > > > >   NHibernate.Linq.Visitors.AssociationRewriteVisitor.Rewrite
>>>> > > > > (Expression expr, ISessionFactoryImplementor factory) in E:\code
>>>> > > > > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\Visitors
>>>> > > > > \AssociationRewriteVisitor.cs:29
>>>> > > > >   NHibernate.Linq.Query.LinqTranslator.Translate() in E:\code
>>>> > > > > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\Query
>>>> > > > > \LinqTranslator.cs:39
>>>> > > > >   NHibernate.Linq.NHibernateQueryProvider.Execute(Expression
>>>> > > > > expression) in
>>>> E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq
>>>> > > > > \NHibernateQueryProvider.cs:27
>>>> > > > >   NHibernate.Linq.Query`1.GetEnumerator() in
>>>> E:\code\nHibernate\trunk
>>>> > > > > \nhibernate\src\NHibernate.Linq\Query.cs:58
>>>> > > > >   System.Collections.Generic.List`1..ctor(IEnumerable`1
>>>> collection)
>>>> > > > > +7663302
>>>> > > > >   System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
>>>> >
>>>> > > > > Also, in case it somehow matters the Helper is creating it's
>>>> > > > > ISessionFactory with:
>>>> >
>>>> > > > >                     var configuration = new Configuration();
>>>> >
>>>> > > > >                    configuration.Configure();
>>>> >
>>>> > > > >                    configuration.AddAssembly(typeof
>>>> > > > > (Season).Assembly);
>>>> >
>>>> > > > >                    _sessionFactory =
>>>> configuration.BuildSessionFactory
>>>> > > > > ();
>>>> >
>>>> > > > > On Mar 6, 2:00 pm, Tuna Toksoz <[email protected]> wrote:
>>>> > > > > > The trunk code with latest NH trunk dll works perfectly fine.
>>>> >
>>>> > > > > > Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://
>>>> > > > > twitter.com/tehlike
>>>> >
>>>> > > > > > Typos included to enhance the readers attention!
>>>> >
>>>> > > > > > On Fri, Mar 6, 2009 at 6:58 AM, Tuna Toksoz <
>>>> [email protected]>
>>>> > > wrote:
>>>> > > > > > > I'll check it out today.
>>>> >
>>>> > > > > > > Tuna Toksöz
>>>> > > > > > >http://tunatoksoz.com
>>>> > > > > > >http://turkiyealt.net
>>>> > > > > > >http://twitter.com/tehlike
>>>> >
>>>> > > > > > > Typos included to enhance the readers attention!
>>>> >
>>>> > > > > > > On Fri, Mar 6, 2009 at 5:34 AM, Randy <[email protected]>
>>>> wrote:
>>>> >
>>>> > > > > > >> I've confirmed that this is an issue w/o Castle Windsor in
>>>> the
>>>> > > > > > >> pipeline.  Is there some sort of configuration necessary
>>>> for
>>>> > > getting
>>>> > > > > > >> LinqToHibernate to work?
>>>> >
>>>> > > > > > >> On Mar 5, 12:50 pm, Randy <[email protected]> wrote:
>>>> > > > > > >> > Sorry that's on my box at home, but it's on trunk of
>>>> nHibernate
>>>> > > and
>>>> > > > > > >> > LinqToNHIibernate as of last night.  I am also using the
>>>> Castle
>>>> > > NH
>>>> > > > > > >> > Facility on the latest build, if that may be part of the
>>>> issue.
>>>> > >  I
>>>> > > > > was
>>>> > > > > > >> > planning on testing it without Castle tonite to further
>>>> isolate
>>>> > > the
>>>> > > > > > >> > issue.  I am very new to NH so I could be missing
>>>> something
>>>> > > basic
>>>> > > > > > >> > here, but I was able to get NH and Castle running just
>>>> fine
>>>> > > until I
>>>> > > > > > >> > tried integrating the Linq stuff.
>>>> >
>>>> > > > > > >> > Thanks!
>>>> >
>>>> > > > > > >> > On Mar 5, 4:19 am, Tuna Toksoz <[email protected]>
>>>> wrote:
>>>> >
>>>> > > > > > >> > > Randy?
>>>> >
>>>> > > > > > >> > > Tuna
>>>> Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://
>>>> > > > > > >> twitter.com/tehlike
>>>> >
>>>> > > > > > >> > > Typos included to enhance the readers attention!
>>>> >
>>>> > > > > > >> > > On Thu, Mar 5, 2009 at 12:18 PM, Tuna Toksoz <
>>>> > > [email protected]>
>>>> > > > > > >> wrote:
>>>> > > > > > >> > > > Trunk doesn't have any changes since february 6.
>>>> >
>>>> > > > > > >> > > > Which revision of NH are you using?
>>>> >
>>>> > > > > > >> > > > Tuna Toksöz
>>>> > > > > > >> > > >http://tunatoksoz.com
>>>> > > > > > >> > > >http://turkiyealt.net
>>>> > > > > > >> > > >http://twitter.com/tehlike
>>>> >
>>>> > > > > > >> > > > Typos included to enhance the readers attention!
>>>> >
>>>> > > > > > >> > > > On Thu, Mar 5, 2009 at 6:24 AM, Randy <
>>>> [email protected]>
>>>> > > > > wrote:
>>>> >
>>>> > > > > > >> > > >> I'm getting the same exception w/ trunk as of 3/4.
>>>>  Anyone
>>>> > > have
>>>> > > > > any
>>>> > > > > > >> > > >> ideas?
>>>> >
>>>> > > > > > >> > > >> On Feb 24, 4:34 pm, James Crowley <
>>>> [email protected]
>>>> >
>>>> > > > > wrote:
>>>> > > > > > >> > > >> > I'm workingagainst the current trunk of nhibernate
>>>> and
>>>> > > > > > >> nhibernate.linq.
>>>> > > > > > >> > > >> > Accessing my data via the standard query methods
>>>> is fine,
>>>> > > but
>>>> > > > > > >> when going
>>>> > > > > > >> > > >> via
>>>> > > > > > >> > > >> > the linq2hibernate provider, I'm getting a
>>>> > > MappingException
>>>> > > > > > >> stating "No
>>>> > > > > > >> > > >> > persister for: System.*" where * is whatever the
>>>> first
>>>> > > > > System.*
>>>> > > > > > >> type
>>>> > > > > > >> > > >> that
>>>> > > > > > >> > > >> > appears in my entity.
>>>> >
>>>> > > > > > >> > > >> > The line where it goes wrong is in
>>>> VisitMemberAccess of
>>>> > > > > > >> > > >> > AssociationRewriteVisitor
>>>> >
>>>> > > > > > >> > > >> > IPropertyMapping mapping =
>>>> > > > > > >> > > >> >
>>>> sessionFactory.GetEntityPersister(expr.Type.FullName) as
>>>> > > > > > >> > > >> IPropertyMapping;
>>>> >
>>>> > > > > > >> > > >> > and it's trying to find an entity persister for
>>>> > > > > "System.String",
>>>> > > > > > >> > > >> > "System.Bool" etc.
>>>> >
>>>> > > > > > >> > > >> > Any ideas? Am I doing something wrong?
>>>> >
>>>> > > > > > >> > > >> > Thanks,
>>>> >
>>>> > > > > > >> > > >> > James
>>>>
>>>>
>>>
>>>
>>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to