Try this: Open one transaction (ITransaction)
do what you are doing Commit the transction. Close the session. On Tue, Nov 29, 2011 at 2:35 PM, sternr <[email protected]> wrote: > EntityA has a ManyToOne relationship to EntityB which uses the > property-ref attribute. > In addition, the relationship is also mapped as cascade="none" and > readonly. > > When I try and save a new instance of EntityA: > > EntityA a = new EntityA(); > a.EntityB = new EntityB() { propertyRef = 33 }; > session.Save(a); > > I get "object is an unsaved transient instance - save the transient > instance before merging". > > In NHibernate 2.1 this worked as expected. > > What am I missing? > > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/nhusers/-/hsLkjIfdUYQJ. > 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. > -- Edgar Muniz Berlinck http://edgarberlinck.wordpress.com/ <http://edgarberlinck.wordpress.com/>http://about.me/edgarberlinck Follow me on Twitter: http://twitter.com/@edgarberlinck "Você pode passar a vida inteira chorando, ou pode passar a vida inteira vendendo lenços. A escolha é sua, e de mais ninguém." -- 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.
