We have a ASP.NET MVC 3 C# project running NHibernate 3 and Castle.ActiveRecord for MySQL, and we trying to get "one session per request" to work with this tutorial.
And it seems to work for some stuff, but when we do SaveAndFlush()
, the command gives us an error:
A different object with the same identifier value
was already associated with the session: 142
And if we try to do only Save()
we got the same message so it has nothing to do with the Flush()
function.
I have find some result when I search but nothing I can use to get it to work.
Something I have not tested because I don't know how I do, is,
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
Any ideas?