Session saveorupdate not updating fat dating site

At runtime, NHIbernate will search the assembly for any embedded resources named *xml and try to parse them. Hobernate sessions are generally not meant to be left open for long times, as far as I can tell. As far as I can tell, NHibernate transactions are pretty much coupled to database transactions.So, if you start an NH tran, you're also starting an ADO transaction. Save( r ) to tell the session to save the new Role object?You do not have to decorate all your classes with attributes.

session saveorupdate not updating-22session saveorupdate not updating-68

NHibernate allso has the concept of transactions in it's API.

Transactions shouldn't be to hard to mentally map into the object realm, since their underlying concepts (ACID) are the same everywhere.

Apparently, these last 2 limitations are set to change I think. I can unit test how my business objects behave without even having to hit the database, simply by not using NHIbernate in those tests ( I have other tests to prove that my mapping files are set up ok)...

You do have to create an XML file that defines how things work. AND, there are tools around to help you auto-generate your XML files, and also your classes if you want.

You could present an interface such as: public void Insert( object o ) //maps to Save() public object Select( Type t, object id ) //maps to Load() public object Update( object o ) //maps to Update, doh!

public object Delete( object o ) // this is almost getting boring!I thought it might be useful to write a quick reference for things that I find a bit confusing. Save(...), Update(...), Lock(...) etc don't do nada in terms of writing to your db.I've been playing with the NHibernate ORM tool quite a lot recently - it's still being ported from the mature Java version of Hibernate, but on the whole I'm loving it, and the developers are doing a great job! As default, the session will actually call the Flush(...) method itself from time to time.Also, what happens to objects that are not registered in the session, are these restored also?TODO You do not have to subclass any kind of persistent base class to make objects persistable.So if the instance is already marked as persistent (for instance, if it was returned from the Find() method), it is never necessary to call the Save method, Hibernate will keep track of changes and update as necessary.

Tags: , ,