All,

We are running into an strange issue with NHibernate 2.0.1. We are
using optimistic concurrecy using timestamp and it is auto generated
by SQL Server 2005.

NHibernate is generating a malformed SQL UPDATE statement when dynamic
update and optimistic concurrency are both enabled using SQL timestamp
fields.


Expected SQL UPDATE statement generated by NHibernate:
exec sp_executesql N'UPDATE Loan SET [CreatedDate] = @p0,
[ModifiedDate] = @p1 WHERE LoanID = @p2 AND [RecordVersion] =
@p3',N'@p0 datetime,@p1 datetime,@p2 int,@p3 varbinary
(8)',@p0='2010-01-25 12:17:09:000',@p1='2010-01-25
12:17:09:000',@p2=40043,@p3=0x0000000000B91B69

Actual SQL UPDATE statement generated by NHibernate:
exec sp_executesql N'UPDATE Loan SET  WHERE LoanID = @p0 AND
[RecordVersion] = @p1',N'@p0 int,@p1 varbinary
(8)',@p0=40043,@p1=0x0000000000B7C985

If dynamic update is disabled, it is no longer an issue.

We are suspecting if there is any issue with GenerateUpdateString()
method in NHibernate which is invoked when dynamic-update=true.

Does anyone ever ran into this issue? If so, how did you solve it?

Appreciate your help.

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