I am getting the following error in an Asp.Net Castle ActiveRecord app when trying to update an object:
"a different object with the same identifier value was already associated with the session"
I've looked up and down my code to see where else the object might have been created but I'm not seeing it. This is baffling as I have the ex...
Hi all,
I have override OnUpdate and do some logging with it. But unfortunately it is called twice. Why such thing happens? How it could be corrected?
Thanks in Advance
UPDATE:
I have extended ActiveRecordBase as follow:
public class ActiveRecordExtender<T> : ActiveRecordBase<T>
{
protected override void OnSave()
{
D...
Hello,
I am using Castle ActiveRecord for .NET version 2.1. for access to an Oracle Express 2008 database. I have a table with a BLOB column mapped like this.
[ActiveRecord("DOCUMENTS", Lazy=true)]
public class DOCUMENTS : ActiveRecordBase<DOCUMENTS>
{
private long id_document;
[PrimaryKey(SequenceName = "seq_D...
I'm going to refactor a growing project from using Castle Activerecord to pure NHibernate or Fluent NHibernate with Service/Repository pattern and POCO.
What would be an easiest way to obtain hbm xml from existing Castle Activerecord model?
Another question, is it possible to convert hbm to Fluent NH and vice versa?
...
Hi all,
I'm trying to get started with Castle ActiveRecord (following the "Getting started with ActiveRecord" screencast).
I created two ActiveRecord classes, one of them named User. I added the relevant strings to the app.config file, and I initialize using:
var config = ActiveRecordSectionHandler.Instance;
ActiveRecordStarter.Initia...
Hi,
I have written a stand-alone Windows Forms application in Visual Studio 2005 using C#, CastleProject ActiveRecord and SQLite as database (using the SQLite connector).
The published application (the binaries from the bin directory) works perfectly on windows vista and windows 7 computers, however when copied to a Windows XP computer...
I am looking for the best approach to using NHibernate and MVC.net.
I have gone through http://www.codeproject.com/KB/architecture/NHibernateArchitecture.aspx
Someone has pointed to the use of Castle project Active record.
My aim is to eliminate the need for any nhibernate dependencies within my domain.
I want a quick and easy do...
My project is C# and uses CastleProject ActiveRecord on MS SQL Server database.
I need to retrieve N consequent items from the database, sorted by some criteria, started from some value.
Example: I have a lot of messages in some table, where message has ID, time and text. I'd like to retrieve messages with position from 100 to 120, whe...
(continued from http://stackoverflow.com/questions/3707200/read-n-consequent-items-by-activerecord)
My project is C# and uses CastleProject ActiveRecord on MS SQL Server database.
I need to understand the order number of an item from a database, if some sorting criteria applied.
Example: I have a lot of messages in some table, where m...
Hey,
I've got a spec project setup that I'm trying to use a SQLite database with. Only I'm having a problem "Session was closed" even when the session appears to only just been created.
First of all in my specs folder I have this configuration:
<activeRecord isWeb="true" threadinfotype="Orange.TicketManager.Specs.Config.HybridWebThrea...
Hi all,
We use a lot of view model builders which pass HQL strings to the ActiveRecordMediator.Execute method to populate search objects for our views.
Doing refactoring occassionally breaks these 'magic' hql strings (without us knowing)
I was wondering if anyone has tried using nhibernate named queries to validate HQL in Castle Activ...
I'm trying to perform a join in ActiveRecord using DetachedCriteria. I can't seem to make it work. There is no relationship defined inside the transfer objects. In SQL I should be able to do this but it seems that ActiveRecord wants to force me to define the relationship. What is the deal?
Can someone point me to some documentation?
...
The official documentations says:
If ActiveRecord is running in a ASP.Net application, you must add this attribute with the value true
So naturally I turned it on and immediately noticed that those background threads (using Quartz.net) that use ActiveRecord to access the Database crash because they try to access HttpContext when th...
I'm using Castle ActiveRecord which uses NHibernate underneath and I've added a property with a formula as follows to one of my entities:
[Property(Formula = "CAST((select count(*) from [User] as u where u.Email = FriendEmail) as bit)")]
public bool FriendRegistered { get; set; }
The problem is that now any query for this entity fails...
Is it possible to set the name of the foreign key constraints added for a HasAndBelongsToMany relationship?
For BelongsTo there is a ForeignKey attribute, but there doesn not seem to be an equivilant for HABTM.
...
Scenario: I have an application that pulls data from a SQL database as well as an Oracle database. I have NHibernate implemented for the SQL side and a co-worker already has a working implementation of the Oracle side (same object different project). I am currently defining a connection string in App.Config and calling this function in P...
Hi all,
Visual Studio 2010 includes a Modeling Project that lets to create UML diagrams like class diagram. We have plenty of class diagrams in VS 2010 Modeling Project and wish to generate Castle ActiveRecord classes from them.
I have searched and found many tools like ActiveWriter, MyGeneration, Active-Record-Gen, The DarkSide, Gener...
Hi...
I'm having a little problem with Validator component from Castle ActiveRecord. I want to localize the messages of the validators attributes, if i use ErrorMessageKey (with the resources from the project) it works fine...but, if i add the FriendlyNameKey property (of the attribute) and try to validate my model it's throws an Argume...
Hello there.
I'm starting with Castle ActiveRecord.
In my application I have a tool create a new data base file (I use SQLite). I create new data base by use ActiveRecordStarter.Initialize() and ActiveRecordStarter.CreateSchema(), then I add some data to this data base.
After this I want to disconnect to this database and connect to an...
Hi all,
It's a long time I'm working with NHibernate session through frameworks like Castle ActiveRecord but never understood what is a session exactly and how should manipulate. Can anybody help? Is there any concise resource?
Thanks in Advance
...