Hi HJ. Are you using the SQLite in-memory database? If so, switch to a disk
file and see if that corrects the problem. When the last connection to a
SQLite in-memory database is closed, the database forgotten. When you
connect to it again, you have a fresh, empty database. I suspect this may be
your problem.
Based on the information you've provided, I don't see any other reason why
this won't work. Can you share your hbm for FileType? Also, have you
examined the NHibernate log output from this section of code? Can you share
that with us?

Jason

On Thu, Oct 8, 2009 at 11:13 AM, HJ <[email protected]> wrote:

>
> I'm new to NHibernate and am trying to follow the getting started
> guide using SQLLite instead of SQL Server. I've got to the stage where
> the database and table are created (correctly), but I'm trying to add
> a class called FileType, howevere, no row is inserted into the
> database (not being saved). This is my code:
>
> public void Add(FileType fileType) {
>    using(ISession session = NHibernateHelper.OpenSession()) {
>        using(ITransaction trans = session.BeginTransaction()) {
>            session.Save(fileType);
>            trans.Commit();
>        }
>    }
> }
>
> I'm very new to this, so having spent the day getting this far,  I
> don't have any idea what to do to further troubleshoot. Could anyone
> shed some light on this please?
>
> >
>

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