These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NHibernate update, delete help!!
PostPosted: Wed Dec 16, 2009 9:42 pm 
Newbie

Joined: Wed Dec 09, 2009 12:49 am
Posts: 3
Hi all,

I use NHibernate 2.1 GA, ASP.NET 3.5 connect to MS SQL Express. I'm successful with session.insert(), but unsuccessful with delete() and update() in one single object. When I run my test, it run well, but when checking my database, I found it didn't change in my database.
Eg.
I have a table Room and data in it:
Code:
Id:2
        Name: 302A
        Price: 30$

I want to change price into 35$, I use session.update(), it ran well but there's not changing in my database. And the same for delete() commandI don't know why. Please help me.

This is my config part for NHibernate in Web.config:
Code:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory>
      <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
      <property name="connection.connection_string">
        Data Source=QUANG\SQLEXPRESS;Initial Catalog=HotelManager;Integrated Security=True
      </property>
      <property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
      <!--HBM Mapping files-->
      <mapping assembly='HotelManager.Core'/>
    </session-factory>
  </hibernate-configuration>


Top
 Profile  
 
 Post subject: Re: NHibernate update, delete help!!
PostPosted: Thu Dec 17, 2009 3:40 am 
Newbie

Joined: Wed Dec 16, 2009 11:54 am
Posts: 2
did you try flushing your session using session.flush()?


Top
 Profile  
 
 Post subject: Re: NHibernate update, delete help!!
PostPosted: Thu Dec 17, 2009 3:43 am 
Newbie

Joined: Wed Dec 09, 2009 12:49 am
Posts: 3
no, I'll try. What does that command do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.