castle-activerecord

ActiveRecordIntegration to support IStatelessSession

it seems that AR Integration doesn't support to open StatelessSession, from looking at: http://github.com/castleproject/Castle.Facilities.ActiveRecordIntegration/blob/master/src/Castle.Facilities.ActiveRecordIntegration/SessionFactoryDelegate.cs looking at line 62, if you don't call OpenSession it will throw exception. I would like to c...

Not-found="ignore" behaviour in Castle Activerecord

Is it possible to implement the 'not-found="ignore"' behaviour of NHibernate on a key mapping when using Castle Activerecord? I am using existing legacy Castle Activerecord classes within an ASP.Net web application to map to a legacy, read only, MSSQL database. I cannot alter the database in any way. The parent Product table has a rela...

Timeout exception when timeout set to infinite time

In my C# .NET 3.5 application I am using CastleProject ActiveRecord over NHibernate. This is desktop application using MS SQL Server 2008. I have set ADO command timeout to 0 to prevent timeout exception during bulk operations: <activerecord> <config> ... <add key="hibernate.command_timeout" value="0" /> </config> ...

Is SessionScope exact equivalent of ISession?

Is Castle ActiveRecord's SessionScope exact equivalent of NHibernate's ISession? If yes, why Castle ActiveRecord has provided a duplicate feature? If no, what are their differences? ...

Within ActiveRecordMediator, should use Execute or CreateSession?

Suppose I'm going to do something that needs access to NHibernate's ISession. For example running a Sql query via ISQLQuery or running a LINQ-to-NHibernate via session.Linq<MyType>(). I know there is 2 way to access ISession: ActiveRecordMediator.GetSessionFactoryHolder().CreateSession() ActiveRecordMediator.Execute() What is the p...

Timeout exception when using NHibernate TransactionScope

This is continuation of http://stackoverflow.com/questions/3844327/timeout-exception-when-timeout-set-to-infinite-time (and I also see unanswered http://stackoverflow.com/questions/3752440/sqlconnection-and-transactionscope-timeout question). I am using CastleProject ActiveRecord over NHibernate, C# 3.5. I have multiple subsequent inser...

Auxiliary Database Objects with Castle ActiveRecord

I know it's possible to run extra DDL scripts with NHibernate. For example triggers or indexes. This feature is NHibernate is named "Auxiliary Database Objects". Is it possible to do same thing in Castle ActiveRecord? ...

ActiveRecordBase does not have OnCreate

ActiveRecordBase has both OnSave and OnUpdate but does not have OnCreate, why and how can it be implemented? I'm using IsUnsaved in OnUpdate to determine if this is a Create or an Edit operation. Is there any better way? ...

Manually managing a join table in Castle ActiveRecord

I have two connected classes defined like this: [ActiveRecord] public class Store : ActiveRecordBase<Store> { [PrimaryKey] public int ID { get; set; } [HasAndBelongsToMany(Table = "StoreCustJoin", ColumnKey = "storeID", ColumnRef = "customerID")] ...

Create a new record with an assigned PK - Castle ActiveRecord

I have a table with a GUID primary key. In ActiveRecord it is setup with a PrimaryKeyType.GuidComb. Is it possible to create this record with a manually assigned PK? If I set the primary key in the record and run Create() a new ID is assigned. If I run Save() I get an error (as one would expect). The why: This table is in two databa...

How do you optimize Castle ActiveRecord calls

How do you optimize ActiveRecord calls in your ASP.NET MVC 2 web applications ? I'm sitting in front of my project and all is fine until I start to fill in data. Like a lot of projects I have a data structure similar to this: A planet has many countries. A country has many states/provinces. A State has many cities. A city has many neig...