Hello All:


I have beginner/intermediate question with SQLite.



I have a class (with two string members) – whose objects I want to be
persisted in the SQLite database. And I am using NHibernate to map the
object data to the database. I have provided the necessary CRUD functions.
However, I am getting an exception while saving a *object*:



1)      “[NHibernate.Id.*IdentifierGenerationException*] = {"could not read
a hi value - you need to populate the table: hibernate_unique_key"} ”

Do I need add any entries to the table “hibernate_unique_key”? What I am
doing is opening “Session” object, and calling save:



private ISession _session;

…

…

…

_session.Save(entity);



2)      Who should create the initial database with empty table? Is it
NHibernate responsibility or I should use a batch file to do that?
Currently, I am using batch file to do this. Here is what my commands look
like. Does it look okay or I messed it up?



drop table if exists Entity;

drop table if exists hibernate_unique_key;

create table Entity (

  Id INTEGER not null,

   ServiceString TEXT,

   Name TEXT,

   primary key (Id)

);

create table hibernate_unique_key (

   next_hi INTEGER AUTO INCREMENT

)

;



Let me know if I should provide more information.



Thanks

Sanky

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