Hi,
not sure if this is the right place for this question; if not- please
let me know where to move this.
I've been using nh 2.1.2 (+ fluent nh) against SQL server 2008 on dev
environment for a few months without much trouble, but suddenly, I'm
getting some very strange behaviour from nhibernate- it seems to be
generating wrong parameter values.
the following errors seem to pop up at random, and disappear as
minsteriously as they've come.
What seems to have helped is deleting the database completely and
initializing it again (using ExportSchema).
for example:
the following statement-
var records= Session.Linq<EmployeeRecord>()
.Where(s => s.UpdateTime >= startTime && s.UpdateTime <=
endTime &&
s.Employee is ManagerEmployee &&
department.ManagerEmployees.Contains((ManagerEmployee)(s.Employee)))
.ToList();
usualy translates to:
SELECT this_.Id as Id14_1_, ...
FROM dbo.[EmployeeRecord] this_ left outer join dbo.[Employee]
employee1_ on this_.Employee_id=employee1_.Id
WHERE employee1_.discriminator = @p0 and
(((this_.UpdateTime >= @p1 and this_.UpdateTime <= @p2))
and this_.Employee_id in (@p3, @p4));
@p0 = 'Domain.ManagerEmployee', @p1 = 09/03/2011 17:40:38, @p2 =
09/03/2011 17:48:58, @p3 = 10, @p4 = 11
which is great.
but now, it sometimes translates to:
ERROR - NHibernate.ADOException: could not execute query
SELECT this_.Id as Id14_1_, ...
FROM dbo.[EmployeeRecord] this_ left outer join dbo.[Employee]
employee1_ on this_.Employee_id=employee1_.Id
WHERE employee1_.discriminator = @p0 and
(((this_.UpdateTime >= @p1 and this_.UpdateTime <= @p2))
and this_.Employee_id in (@p3, @p4));
Positional parameters: #0>Domain.ManagerEmployee #1>09/03/2011
17:42:10 #2>09/03/2011 17:50:30
#3>Domain.ManagerEmployee #4>Domain.ManagerEmployee
(note the values for parameters #3 and #4).
any help would be appriciated.
thanks,
Jhonny
--
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.