SaveOrUpdate using nHibernate is getting the following error.
UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT'
If I set arithabort on:
var command = session.Connection.CreateCommand();
command.CommandText = "Set Arithabort on";
command.ExecuteScalar();
Instead of getting the update failed, I ge...
I'm working on a legacy system that is using the enterprise library validation block to add a broken rule when an object is not valid. Then the user is returned a message based on this error and told the object was not updated.
The only issue is that now I'm using NHibernate to persist these objects -NHProf shows an update to the obj...
I have some existing asp.net membership and roles tables in a legacy db and I am mapping them to new entities with Fluent Nhibernate.
I also generate the schema directly from Fluent Nhibernate and I then manually tweak the generated sql script to exclude the existing tables.
Is it possible to say to Fluent Nhibernate to exclude from ...
I'm using nHibernate to update 2 columns in a table that has 3 encrypted triggers on it. The triggers are not owned by me and I can not make changes to them, so unfortunately I can't SET NOCOUNT ON inside of them.
Is there another way to get around the TooManyRowsAffectedException that is thrown on commit?
Update 1
So far only way I'...
I am new to NHibernate and am running into some issues getting the Automap functionality to work properly. Here are a couple of issues I am having.
The getting started wiki for Fluent NHibernate (http://wiki.fluentnhibernate.org/Getting_started) defines a sample with store, product, and employee classes--as well as the mapping for thos...
I have an entity model where the base class in an inheritance structure has an association with another class, and was wondering if the subtypes of the base class will have the association mapped up as well?
For a bit more information, here is a basic outline of this part of the system:
Transport is the base class, and has an associati...
In my business model I have Entity class (IPoint interface) that has a list of child elements of the same type. The link in DB is made via many-to-many table. The Entity has also discriminator for subclassing (IPoint implementations).
At first I made simple many-to-many mapping for this and all was working good. But then I've made (as b...
I'm trying to put together a presentation for my local .NET user group on NHibernate. I want to demonstrate how one might convert an existing application's data access layer to use NHibernate, but first I need an application to convert.
What would be a good example domain that would allow me to demonstrate the main features of the ORM...
I am using Fluent-NHibernate (with automapping) to generate my tables but would like to choose a different clustered index than the ID field which is used by default. How can you create clustered indexes with Fluent NHibernate on a field other than the default Primary Key field?
The primary reasoning behind this is simple. I am using Gu...
I'm using NHibernate HiLo as my identity generator. I currently have a sepperate table in my database for each of my entity tables. For example I have Customer and CustomerKey table, each with a NextHiLo column.
What would be a great thing to have is a single table that holds key for all the others. Idealy would be if i could have a tab...
I have updated the Sharp Architecture solution (SharpArchitecture_1.0_RTM_build_486) (my local copy) and referenced NHibernate 2.1.0.4000 instead of NHibernate 2.1.0.3001 dll. I have also updated all other NHibernate related references in Sharp Architecture solution.
I was able to rebuild Sharp Architecture and to pass all the tests us...
I'm using NHibernate 2.1 with the LINQ provider and the results I get back from this query have multiple root nodes:
public IList<Country> GetAllCountries()
{
List<Country> results = (from country in _session.Linq<Country>()
from states in country.StateProvinces
orderby country.Dis...
I'm using HashtableCacheProvider as NHibernate second level cache provider for my web application. The problem is that it seems that NHibernate keeps cached data even if I restart my IIS. I thought that cached data will disappear when in that case. Can someone explain how does this thing work, and how can I clear the second level cache w...
Class A
{
Guid ID{get;}
ISet<B> ClassBs {get;}
}
repository
public IList<B> GetAsBs(A a)
{
ICriteria ACriteria = Session.CreateCriteria(typeof(A));
ICriteria BCriteria = ACriteria.CreateCriteria("ClassBs");
A.Add(Restrictions.Eq("ID", a.ID));
return BCriteria.List<B>();
}
I can accomplish this in HQL np but want to use criteria
i am ...
Using Castle ActiveRecord / NHibernate: Is there a way you can force an ICriterion on all queries on a table?
For example, a good amount of of my tables have a "UserId" column. I might want to ensure that I am always selecting rows for the logged in user. I can easily create an ICriterion object, but I am forced to supply it for differe...
Hi,
i'm using NHibernate with Sdf database. In my hibernate.cfg.xml file i've set:
<property name="hbm2ddl.auto" value="update"/>
But this does not seem to work at all. "Update" attribute should make NHibernate generate missing tables and columns during application launch, but it does not happen.
If i want missing tables geenrated I...
Currently we have a project to implement an Internet Banking site, and we are evaluating using Nhibernate on it. ¿Is NHibernate suitable for this kind of application, where performance is important and there will be a large quantity of users doing operations simultaneously?
¿Do you know any successfull stories of using NHibernate in th...
I moved away from typed DataSets and I (happily) never looked back. I am looking into NHibernate for persistence of my objects, and would like to see some text such as 'NHibernate for (DataSet) Dummies'. Some text that will assure me that I will be able to seamlessly update data islands, have possibilities of class inheritance, and so ...
I am attempting to use the Fluent-NHibernate automapping functionality (in the latest version of the software) and am running into problems using Guids as the Primary Key fields. If I use integer fields for the primary keys, the tables are generated successfully and all Nhibernate functionality seems to work fine. FYI, I am using NHibern...
I'm new to NHibernate and trying to create my first mapping.
I have created a class like this (my example is simplified):
public class Buyer
{
public int BuyerID { get; set; }
public string Name { get; set; }
public decimal AverageOrderAmount { get; private set; }
public DateTime LastOrderDate { get; private set; }
}
...