Are you really, really sure that you want a new session? Most event listeners just use a child session... @event.Session.GetSession(EntityMode.Poco)
In any case, if you post the actual message and stacktrace of the error we might be able to help you better. Diego On Tue, Mar 9, 2010 at 10:53, nicklang <[email protected]> wrote: > Hi, > > In IPreUpdateEventListener.OnPreUpdate() I'm trying to get a new > session like this: > > public bool OnPreUpdate(PreUpdateEvent @event) > { > ISession s = @event.Session.SessionFactory.OpenSession(); > > Webpage p = new Webpage(); > p.Name = "test"; > > s.Save(p); > s.Flush(); > > return true; > } > > Is this the right way to go about this? I keep getting errors about > missing tables when I try to Save() my new entity. > > Thanks for any insight you may have! > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- 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.
