Re: CreateCriteria() CreateAlias()

2009-10-22 Thread Markus Zywitza
Yes, it should work. -Markus 2009/10/22 Bruno Leitão de Oliveira uncod...@gmail.com: Can i do it with CreateCriteria()? CreateCriteria(Project, p); CreateCriteria(P.Contract, pc); ... On Oct 22, 4:45 am, Markus Zywitza markus.zywi...@gmail.com wrote: HQL is far better suited

Re: activerecord - saving one-to-one

2009-11-11 Thread Markus Zywitza
Yes, but you should use it the other way round. In this example, no user can exist without profile (it needs the foreign key as its ID), but the profile can exist without the user. For me, that violates all I know about users and profiles. -Markus 2009/11/11 jeroenh jeroen.haegeba...@gmail.com:

Re: ActiveRecord: Any[] TypeColumn not being populated

2009-11-29 Thread Markus Zywitza
You can set Inverse=true for the collection to circumvent this. -Markus 2009/11/17 JakeS jakesteven...@gmail.com: I add a feedback through a method (on the Team and User classes) like this: public void AddFeedback(WorkerFeedback feedback) {  FeedbacksReceived.Add(feedback);  //Do some

Re: Castle ActiveRecord-- Turn a list of IDs into the actual objects

2009-12-01 Thread Markus Zywitza
from User u where u.UserID in (:myListOfIds) -Markus 2009/12/1 JakeS jakesteven...@gmail.com: I've had to resort to using SQL for a query to get a list of IDs back.  I fought with Criterion and HQL for a long time, and finally fell back to this-- var query =    @    SELECT    

Re: How To Create Relationship Without Using Inverse

2009-12-20 Thread Markus Zywitza
Short answer: you can't do that without inverse. Long answer: When you add a new post to a blog and save the blog, the post doesn't exist on the DB in that moment, so NH will save it. It will simply take the post object and insert its contents in the DB and since the Blog reference is null,

Re: Best way to retrieve this

2009-12-21 Thread Markus Zywitza
It seems you are interested in lazy loading, right? For example, if Steps is lazily loaded, you can do Case.FindAll() without having them loaded unless you access Case.Steps. http://castleproject.org/activerecord/documentation/trunk/advanced/tuning.html#lazyload

Re: How To Create Relationship Without Using Inverse

2009-12-21 Thread Markus Zywitza
at the bottom of the page here http://www.castleproject.org/activerecord/documentation/trunk/usersguide/relations/hasmany.html On Dec 20, 12:39 pm, Markus Zywitza markus.zywi...@gmail.com wrote: Short answer: you can't do that without inverse. Long answer: When you add a new post to a blog

Re: ASP.NET MVC Users + BelongsTo

2009-12-27 Thread Markus Zywitza
All those options are perfectly valid. If you only have to read the user data, using a view is good practice. If you want an User object, you will need a User class of course. You can link it to the table by using [ActiveRecord(aspnet_Users] public class User : ActiveRecordBase {

Re: AR+WCF Nightmares..

2010-01-03 Thread Markus Zywitza
When you send your entities over the wire, you better don't inherit from ActiveRecordBase. Perhaps this solves your problem. -Markus 2010/1/3 dylanj dylancjan...@gmail.com: Hi All, Sorry if this is a n00b thing to ask - I've only been into DotNet/C# for about two weeks. But basicly what I

Re: inheritence with composite user type

2010-01-09 Thread Markus Zywitza
It's an AR issue then and not an NH issue. Can you open an issue at donjon? -Markus 2010/1/8 MixMasta mgluc...@gmail.com: the hbm files do not contain the definition for the composite type. joined-subclass name=CustomPromotionRecord, Business table=PokerPromotion      key

Re: inheritence with composite user type

2010-01-09 Thread Markus Zywitza
Forget this mail. We already have an (ancient) issue on this: AR-ISSUE-180. -Markus 2010/1/9 Markus Zywitza markus.zywi...@gmail.com: It's an AR issue then and not an NH issue. Can you open an issue at donjon? -Markus 2010/1/8 MixMasta mgluc...@gmail.com: the hbm files do not contain

Re: inheritence with composite user type

2010-01-09 Thread Markus Zywitza
Fixed in trunk. Please update to trunk and try whether it works. -Markus -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-us...@googlegroups.com. To unsubscribe from this group, send

Re: ActiveRecord 2.1 Beta 1 released

2010-01-11 Thread Markus Zywitza
= extra mapping? On Jan 10, 4:09 pm, Markus Zywitza markus.zywi...@gmail.com wrote: Hi all I just uploaded AR 2.1 beta 1 to SourceForge. This update contains new functionality and loads of bugs fixes compared to AR 2.1 Alpha 1. Please test it, GA release is due on Wednesday. Lots of thanks

ActiveRecord 2.1 released

2010-01-13 Thread Markus Zywitza
FYI: ActiveRecord 2.1 was released on SourceForge. I will write an announcement later. -Markus -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-us...@googlegroups.com. To unsubscribe

AR 2.1.1 released

2010-01-15 Thread Markus Zywitza
A minor release is available on SourceForge. There is only one change: Castle Validator is updated to v1.1.1. This release is mainly for bundling with the upcoming MonoRail release, which requires Validator 1.1.1. If you are developing rich clients, stay tuned for 2.2 Alpha scheduled for end of

Re: NotSupportedException when ValidateGroupNotEmpty attribute is used in ActiveRecord class

2010-01-18 Thread Markus Zywitza
Sorry, I've been offline over the weekend. I don't know why AR is adding Validators, I think it's a remnant of the time when Validation was part of AR. Perhaps we just remove that part and see whether the tests still pass. -Markus 2010/1/15 G. Richard Bellamy rbell...@pteradigm.com: Markus, I

Re: [ActiveRecord] Join with the same table

2010-01-21 Thread Markus Zywitza
What do you want? Do you need to add the result in the DB or is this a transient property. In any case, you need to run the SQL query in the getter as shiwn in the documentation. If you need to cache the result in the database, add [Property(Access=PropertyAccess.ReadOnly)] to the property. You

Re: [ActiveRecord] Join with the same table

2010-01-22 Thread Markus Zywitza
= 0; foreach(object obj in o) {   object v =    o[i ++]; //compilation error } - Original Message - From: Markus Zywitza markus.zywi...@gmail.com To: castle-project-users@googlegroups.com Sent: Thursday, January 21, 2010 4:11 AM Subject: Re: [ActiveRecord] Join with the same table

Re: [Active Record] Intercept Event

2010-01-25 Thread Markus Zywitza
Look here: http://using.castleproject.org/display/AR/NHEventListenerSpecs C3 is not supported yet, since ARFacility doesn't contain EventListener support ATM. -Markus 2010/1/25 Cesar Sanz the.email.tr...@gmail.com: Hi!! ActiveRecordStarter.EventListenerComponentRegistrationHook Thanks,

AR 2.1.2 was just released

2010-01-30 Thread Markus Zywitza
Changes to 2.1: Castle Validator updated to 1.1.1 Using official NHibernate.dll bug fix (AR-ISSUE-280) -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-us...@googlegroups.com. To

Re: Question about One-To-Many relationship

2010-01-31 Thread Markus Zywitza
[ActiveRecord] public class Entity { [PrimaryKey] public Guid Id {get; set;} [BelongsTo] public Entity Parent {get; set;} [HasMany] public IListEntity Children {get;set;} } On ActiveWriter, I cannot say anything. I never used it. -Markus 2010/1/31 Marcello Felipelli

Re: Using Same Object for Different Table , is it possible?

2010-02-01 Thread Markus Zywitza
No, but you can use a history database and use DifferentDatabaseScope to put it there before you destroy the one in the original database. -Markus 2010/2/1 chen atlas atlasc...@gmail.com: If i have Object and i want to move it to History Table with the same structure? is it possible to use

Re: Create() and get ID Back / Nested Insert

2010-02-01 Thread Markus Zywitza
Can you show actual code please? -Markus 2010/2/1 chen atlas atlasc...@gmail.com: My question is: i have object ContactObject (id,name,street...) and other object ContactsOfUsers (userId, name, ContactObject(BelongsTo(contactid))) if i want to create object i do like this:

Re: MsSql Procedure

2010-02-02 Thread Markus Zywitza
See here: http://www.castleproject.org/activerecord/documentation/trunk/usersguide/nativesql.html Instead of SELECT... you would like to use EXECUTE ... of course. The NHibernate docs show how to make objects from the results: http://nhforge.org/doc/nh/en/index.html#querysql -Markus 2010/2/2

Re: ActiveRecord Medium Trust Problem

2010-02-03 Thread Markus Zywitza
You need to compile DynamicProxy as well. -Markus 2010/2/3 Mark m...@dotpitchstudios.com: I've been trying to build a copy of ActiveRecord that runs in a Medium trust environment but seem to be having some problems. I've pulled down Core (https://svn.castleproject.org/svn/castle/Core/

Re: ASP.NET MVC 1.0 + NHibernate 2.1 + Castle.Windsor

2010-02-09 Thread Markus Zywitza
Billy McCafferty has; he calls it Sharp Architecture, as Aunt Google would have told you on simply pasting your question there... -Markus 2010/2/9 Leonardo Lima goo...@leonardolima.com.br: Hi all, Anyone have an example to build an App using ASP.NET MVC 1.0 + NHibernate 2.1 and

Re: Active Record Session Management

2010-02-09 Thread Markus Zywitza
Trunk has a brand-new feature called IConversation for session management in GUIs. Docs: http://using.castleproject.org/display/AR/Using+the+Conversation+Pattern -Markus 2010/2/10 Blair system.predic...@gmail.com: Hi I would like to know how best to use Active Record with a Repository

Re: Active Record Session Management

2010-02-10 Thread Markus Zywitza
session source and provide it to the service layer and repository layers and return flattened dto's to the ui. I can use castle to inject and save a session on thread static. Is there anything wrong with this approach? On Feb 10, 3:37 pm, Markus Zywitza markus.zywi...@gmail.com wrote: Trunk has

Re: Active Record Session Management

2010-02-11 Thread Markus Zywitza
system.predic...@gmail.com: I want the service to call the repositories and the service layer to flatten the dto's so i need to use the same session accross many repositories. On Feb 10, 4:18 pm, Markus Zywitza markus.zywi...@gmail.com wrote: If you are using a repository layer that uses

db4o Facility

2010-02-19 Thread Markus Zywitza
Hi I have updated the db4o facility we moved to attic since no one needed it anymore. Well, I'm about starting a project which will use db4o, so I blew away the attic's dust and updated the facility. I'm fine with keeping it in the attic for now, but if anyone else uses or plans to use it, I

Re: Using Same Object for Different Table , is it possible?

2010-02-21 Thread Markus Zywitza
2010/2/17 chen atlas atlasc...@gmail.com: and how do i change the Database scope? see DifferentDatabaseScope in documentation cant i change attribute with reflaction? No, you had to re-initialize ActiveRecord to make the new attribute work. or do you know how to create a class that inherits

Configuring Facility without XML

2010-02-25 Thread Markus Zywitza
Hi want to register a facility (Db4oFacility) that requires some configuration. I can do this with XML but for my integration tests, I'd prefer using an XML-less method. However, there IConfiguration is get-only in AbstractFacility and the only way to add a IConfiguration would be calling

Re: Using Same Object for Different Table , is it possible?

2010-03-04 Thread Markus Zywitza
atlasc...@gmail.com wrote: thank you very much for you answer! very detailed! On Feb 21, 1:33 pm, Markus Zywitza markus.zywi...@gmail.com wrote: 2010/2/17 chen atlas atlasc...@gmail.com: and how do i change the Database scope? see DifferentDatabaseScope in documentation cant i

Re: Set the next value of a sequence to a property

2010-03-04 Thread Markus Zywitza
Short answer: No way Long answer: Either use the sequence with ADO.Net or build an ID-Service. If the ID is a domain requirement (i.e. invoice numbers that must be sequential etc.), I usually opt for the latter. -Markus 2010/3/4 Milton Pividori milto...@gmail.com: Hi. I am using Castle

Re: HasAndBelongsToMany and deleting

2010-03-09 Thread Markus Zywitza
It's directly before your eyes: var state= State.Find(...); supplier.StatesServices.Remove(state); supplier.Save(); // only when not using SessionScope BTW: IF you had a bidirectional relationship, you would have to mark one end as inverse and remove from the collection that is not inverse.

Re: ActiveRecord - one parent and one child

2010-03-20 Thread Markus Zywitza
You are using the wrong model. I have solved a similar problem by using [ActiveRecord] public class Document { [HasMany] public IListDocumentVersion Versions {get;set;} [BelongsTo] public DocumentVersion LatestVersion {get;set;} public DocumentVersion CreateNewVersion() { //

Re: AW: Security bug - where report?

2010-03-30 Thread Markus Zywitza
henry.concei...@gmail.com 2010/3/30 Andreas H. andreasmail2004-cas...@yahoo.de I delete all previous Mailing List E-mail's... Please can you write me the e-mail Address? -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this

Re: ActiveRecord mapping

2010-04-13 Thread Markus Zywitza
What is the query (in HQL or LINQ)? -Markus 2010/4/13 Diego Dias diego.d...@gmail.com Good morning, guys. I'm with a problem with the query that NHibernate generates. My mapping is like bellow: public class Matricula { [BelongsTo(IdTurma, NotNull=True)]

Re: ActiveRecord mapping

2010-04-13 Thread Markus Zywitza
Can you share the ICriteria query code then? -Markus 2010/4/13 Diego Dias diego.d...@gmail.com I use ICriteria and is query I get in sql profile. 2010/4/13 Markus Zywitza markus.zywi...@gmail.com What is the query (in HQL or LINQ)? -Markus 2010/4/13 Diego Dias diego.d...@gmail.com

Re: ActiveRecord mapping

2010-04-16 Thread Markus Zywitza
abr, 14:52, Diego Dias diego.d...@gmail.com wrote: My criteria have this: { IdTurma = -99 Usuario.NomeCompleto asc } Being that I create my criteria by Matricula 2010/4/13 Markus Zywitza markus.zywi...@gmail.com Can you share the ICriteria query code then? -Markus

Re: Bug found in ActiveRecordMediator.cs

2010-04-25 Thread Markus Zywitza
Can you open an issue please? -Markus 2010/4/24 DanielT dft...@gmail.com I believe I found a bug in Castle.ActiveRecord.ActiveRecordMediator.cs. For the method SaveCopyAndFlush(object instance), the return type is void. According to the XML comment, there should be a return type of object.

Re: Bug found in ActiveRecordMediator.cs

2010-04-26 Thread Markus Zywitza
://support.castleproject.org/projects/AR/issues/view/AR-ISSUE-282 On Apr 25, 3:26 am, Markus Zywitza markus.zywi...@gmail.com wrote: Can you open an issue please? -Markus 2010/4/24 DanielT dft...@gmail.com I believe I found a bug in Castle.ActiveRecord.ActiveRecordMediator.cs

Re: how do i make simple join between two tables

2010-05-12 Thread Markus Zywitza
Stop thinking relational! If you think in joins, you don't need AR or NH at all. Your model should be instead: class Board: int Id string Name int Size class Game: int Id *Board* Board // not int BoardId, we have objects here, not relations! Player Player // same as before, player

Re: Criteria API problem

2010-05-22 Thread Markus Zywitza
Any reason not to use: from Question q where q.RelatedQuestions.size 1 If you are afraid of HQL, try NHibernate Workbench: http://nhforge.org/blogs/nhibernate/archive/2010/05/19/nhibernate-workbench.aspx -Markus 2010/5/22 Cosmo ja...@list.pl Hello Guys! This SQL works for me: select *

Re: Criteria API problem

2010-05-24 Thread Markus Zywitza
.}. Regards, Jakub On 22 Maj, 17:35, Markus Zywitza markus.zywi...@gmail.com wrote: Any reason not to use: from Question q where q.RelatedQuestions.size 1 If you are afraid of HQL, try NHibernate Workbench: http://nhforge.org/blogs/nhibernate/archive/2010/05/19/nhibernate-wor

Re: RelationType.List violates Primary Key Constraint.

2010-05-26 Thread Markus Zywitza
I suspect the reason, but I want to see the mappings (classes with attributes) of both types first. However, this might help you, especially the sample mapping for a list at the end of the post: http://mortslikeus.blogspot.com/2009/06/understand-activerecord-mapping.html -Markus 2010/5/26 Jason

Re: Using a long running ScopedConversation - ActiveRecord

2010-05-28 Thread Markus Zywitza
Although I created the ScopedConversation for GUI support of AR, I had not the use of Conversation per Application Instance in mind. The real benefit of conversation per form is that you can lazy load by form. Using it for keeping a large number of objects in 1st level cache is not good because

Re: Peformance

2010-05-28 Thread Markus Zywitza
Sorry, my crystal ball is off duty right now. Can you please send us your mappings and your usage scenario? -Markus 2010/5/28 raghavsri raghavendra...@gmail.com Hi I am experiencing very poor peformance ,when i am using FindOne and FindAll fucntionality ,in activerecord. there are only 4

Re: Peformance

2010-05-29 Thread Markus Zywitza
( new ICriterion[] { Expression.Eq(SerialNumber, serialNumber) } ); it is taking lot of time, On May 29, 2:17 am, Markus Zywitza markus.zywi...@gmail.com wrote

Re: Peformance

2010-05-30 Thread Markus Zywitza
know if you have any suggestion, how to handle the things when we use lazy loading Once again thaks for you quick response... Regards Raghavendra On May 29, 12:11 pm, Markus Zywitza markus.zywi...@gmail.com wrote: You have to use lazy loading. With the current mapping, if you load one

Re: Peformance

2010-05-30 Thread Markus Zywitza
, could you move the documentation for AR to stw wiki? Krzysztof On 2010-05-30 20:09, Markus Zywitza wrote: This usually means that there was no common session available for loading the instances lazily. You have to use either SessionScope or IConversation, depending on the type

Re: Using a long running ScopedConversation - ActiveRecord

2010-06-04 Thread Markus Zywitza
Inline: Dan Jasek dan...@jasek.org: Is there a hook I can connect to to detect when a session has failed? If you are using IConversation, then it has an extension point for it as shown in the docs. Also, is it possible to determine if an AR object is attached to an active session or not?

Re: Querying items in a HasAndBelongToMany relationship

2010-06-12 Thread Markus Zywitza
Why don't you use HQL for that, it is dead simple: select p.Category from Product p where p.Brand = ? -Markus Am 13. Juni 2010 06:43:28 UTC+2 schrieb Mark Borg markmb...@gmail.com: OK Guys, solved using a native SQL query SELECT * FROM prod_productcategory pc JOIN prod_productcategories

Re: Querying items in a HasAndBelongToMany relationship

2010-06-13 Thread Markus Zywitza
query 'SELECT p.Category'. Is there something in HQL that can handle such associations ? Mark On Jun 13, 7:30 am, Markus Zywitza markus.zywi...@gmail.com wrote: Why don't you use HQL for that, it is dead simple: select p.Category from Product p where p.Brand = ? -Markus Am 13. Juni

Re: AR: multi-tenancy support

2010-07-11 Thread Markus Zywitza
Would the following strategy suit your intentions: 1) Create a database and configuration per tenant: activerecord config tenant=cust1.../config config tenant=cust2.../config config tenant=cust3.../config /activerecord 2) Choosing tenant when starting a SessionScope: string tenant = cust1;

Re: Returning multiple entites together

2010-07-12 Thread Markus Zywitza
Hi Visar you should try using the Execute()-Callback. It gives you an ISession, so you can do with it everything you normally do with NH. If you have ideas on improving querying in AR, I'd be glad to listen. -Markus 2010/7/12 Visar Uruqi visar.ur...@gmail.com: Hello I'am new to ActiveRecord

Re: Returning multiple entites together

2010-07-12 Thread Markus Zywitza
Hi Visar The target type is not the type being returned. AR allows to use multiple databases. The database for each type is chosen through an abstract baseclass. Without providing the target type, AR cannot know which session or session factory it has to use to run the query. The return of

Re: Why OnUpdate does not work in cascaded mode?

2010-07-12 Thread Markus Zywitza
Can you post the code please? -Markus 2010/7/12 Afshar Mohebbi afshar.mohe...@gmail.com: Hi, Suppose we have two entities: Blog and Post. Blog has many Posts. I have overridden OnUpdate in Post class, but it is causing to save Posts in an incorrect way. I tried OnFlushDirty, but this has

Re: Returning multiple entites together

2010-07-12 Thread Markus Zywitza
(); //===end so on        } On Jul 12, 3:23 pm, Markus Zywitza markus.zywi...@gmail.com wrote: Hi Visar The target type is not the type being returned. AR allows to use multiple databases. The database for each type is chosen through an abstract baseclass. Without providing

Re: Using Oracle's Connect By clause in a DetachedCriteria

2010-07-23 Thread Markus Zywitza
No idea. Perhaps you should ask at NHibernate users or stackoverflow how to mix up Criteria and SQL queries. -Markus 2010/7/22 Mike lengt...@gmail.com: How can I use Oracle's Connect By clause in a detached criteria? I already have a working query using DetachedCriteria but now I need to add

Re: Using a long running ScopedConversation - ActiveRecord

2010-07-24 Thread Markus Zywitza
would include: * Setting cache size and age targets. * Monitoring object references. * Auto-eviction of old and unused objects. * Recovery from failed sessions. Once I get more familiar with the code base, I may try to put some of these pieces in place... -Dan On Jun 4, 7:31 am, Markus

Re: AR: multi-tenancy support

2010-07-24 Thread Markus Zywitza
Hi Markus sorry for being late, but I'm stuck in a heap of work... 2010/7/14 Markus markus.ste...@web.de: Hi Markus! This idea comes closer to what I was thinking about, yes. I'm just wondering if this approach also works well together with the existing configuration schema and the

Re: TransactionScope and SessionScope [ AR ]

2010-07-27 Thread Markus Zywitza
It's ReadCommitted --- you can only read committed rows, but when they are changed, you have to wait until the transaction commits. The problem with SessionScopes is that each SessionScope starts its own ISession and ITransaction. If you nest SessionScopes, you nest sessions. Generelly, session

Re: Using a long running ScopedConversation - ActiveRecord

2010-07-27 Thread Markus Zywitza
objects is because I can not get a BelongsTo reference to lazy load.  If anyone else has gotten a lazy BelongsTo, I would love to hear how. -Dan On Jul 24, 8:00 am, Markus Zywitza markus.zywi...@gmail.com wrote: Hi Dan for your tree, I recommend a manual proxy that only has the tree

Re: ActiveRecord NHibernate.Search not working.

2010-07-28 Thread Markus Zywitza
IIRC, where 1=0 is a placeholder in NHibernate that or-ed with the actual search criteria. This would mean that your lucene query has no results. -Markus 2010/7/26 Jason Sznol jasonsz...@gmail.com: Can anyone help me get the NHibernate.Search functionality working in my project. I have been

Re: TransactionScope and SessionScope [ AR ]

2010-07-29 Thread Markus Zywitza
2010/7/29 zonkzen zonk...@gmail.com: There's still two questions: 1. Since now I have only one Session, all nHibernate objects are attached to it ( despite the FlushMode.Never, but it's by design ). Question is really not precise and kind of stupid, cause it's hard to measure, but how many

Re: attach entity in ActiveRecord

2010-07-29 Thread Markus Zywitza
I simply call entity.Save() Something wrong with that? -Markus 2010/7/29 Dan Jasek dan...@jasek.org: The NH lock function is the only method I have found.  However, you don't need to create an ISession to use it.  An AR object has access to the ISession factory holder.  I have an abstract

Re: How to properly implement ActiveRecord

2010-07-31 Thread Markus Zywitza
2010/7/31 josh robb josh_r...@fastmail.fm: There's nothing wrong with passing a LicenseRepository into a method on the Software class. This allows easy testing and also stops coupling your models to persistence. class Software{   bool IsValidLicenseCombination(LicensesRepository repo) {    

Re: How to properly implement ActiveRecord

2010-08-02 Thread Markus Zywitza
). 2010/7/31 Markus Zywitza markus.zywi...@gmail.com 2010/7/31 josh robb josh_r...@fastmail.fm: There's nothing wrong with passing a LicenseRepository into a method on the Software class. This allows easy testing and also stops coupling your models to persistence. class Software{   bool

Re: How does Castle.ActiveRecord override virtual properties?

2010-08-08 Thread Markus Zywitza
Not at all. This doesn't work with NH2.1, only with NH3.0 Alpha. AR uses NH2.1. -Markus 2010/8/8 omer katz o...@cinex.co.il: In active record to write a model you write: [ActiveRecord(TableName)] public class Model {    [Property(SomeField)]    public virtual string SomeField { get; set;

Re: NHibernate 3.0 w/ ActiveRecord

2010-08-10 Thread Markus Zywitza
Well, none version is planned before NH3.0 is at least beta or RC. The problem is that we have two additional dependencies on NH in AR: NH Linq and NH Search. NH Linq can be omitted if we change AR Linq to use the new LINQ provider in NH3.0 (we should merge AR Linq into AR then since NH3.0 won't

Re: session scope and transaction scope

2010-08-12 Thread Markus Zywitza
Scopes are an infrastructure concern. The best bet is to use SessionScope per web request. If you are working with a GUI,you should rather use IConversation. SessionScope uses an implicit transaction since AR 2.0, so you should be fine with a single SessionScoep unless you need to rollback in

Re: ScopeMachineryException thrown when performing parallel queries

2010-08-12 Thread Markus Zywitza
I guess you have a web app. The problem is that the SessionFactoryHolder stores the created session in the HttpContext, which the thread doesn't have access to. You can try (without any warranty) HybridThreadScopeInfo instead of WebThreadScopeInfo. The better idea is to use conversations: Create a

Re: ScopeMachineryException thrown when performing parallel queries

2010-08-12 Thread Markus Zywitza
...@kitchenpc.com: I'll look into the conversations idea..  I'm kinda an NHibernate/Castle newbie, can you point me to some documentation or example code on how to do this?  I'd greatly appreciate it.  Thanks!! Mike On Thu, Aug 12, 2010 at 4:53 AM, Markus Zywitza markus.zywi...@gmail.com wrote: I guess

Re: SubSelect Oddity

2010-08-17 Thread Markus Zywitza
Sorry, incomplete mail last time. I was playing with Thunderbird, but it doesn't work as expected Am 17.08.2010 00:05, schrieb Dan Jasek: I have an AR class (lets call A) with a HasMany relationship where Fetch is set to FetchEnum.SubSelect (called RelB). I have a test which opens up a

Re: SubSelect Oddity

2010-08-18 Thread Markus Zywitza
where the issue is coming from. -Dan On Aug 17, 1:02 am, Markus Zywitza markus.zywi...@gmail.com wrote: Sorry, incomplete mail last time. I was playing with Thunderbird, but it doesn't work as expected Am 17.08.2010 00:05, schrieb Dan Jasek: I have an AR class (lets call A) with a HasMany

Re: Clarification on API

2010-08-19 Thread Markus Zywitza
Without my crystal ball, I can only say: Create() - Insert new record Update() - Update existing record Save() - Insert or update depending on PK value given or not. for any other help, I need to see the classes and the operations that creates the problem. -Markus 2010/8/19 raghavsri

Re: Lazy object session management - AR

2010-08-21 Thread Markus Zywitza
Hi Dan I had the same idea some time ago and experienced the same problems. In theory it is possible to create a custom bytecode provider and collection proxies to make lazy-loading work without SessionScope, yet it requires us to use a custom built NHibernate. But back to the original idea: Why

Re: Lazy object session management - AR

2010-08-22 Thread Markus Zywitza
this, would you be interested in adding it to AR? -Dan On Aug 21, 12:56 am, Markus Zywitza markus.zywi...@gmail.com wrote: Hi Dan I had the same idea some time ago and experienced the same problems. In theory it is possible to create a custom bytecode provider and collection proxies

Re: Active Record Errors

2010-08-26 Thread Markus Zywitza
NH 2.1 still uses DP 2.1 and CC 1.1 (current NH 3.0 alpha 2 does as well). Unless you compile everything yourself, you won't be able to use AR 2.1 with CC/CW 2.5. -Markus 2010/8/26 NickUk ntcod...@gmail.com Hi Guys, I've just upgraded an MVC 2 app to use the lates core and windsor releases

Re: ARFetch with Checkbox Lists

2010-09-07 Thread Markus Zywitza
I don't understand why you need ARFetch or ARDataBind here. Simply use: PropertyBag[applications] = Applications.FindAll(); -Markus 2010/9/6 bluesliverx bksavi...@gmail.com: After messing with it for awhile, I can't seem to find how to use ARFetch with the FormHelper checkbox lists.  The

Re: Using session per conversation with ActiveRecord

2010-10-19 Thread Markus Zywitza
Hi Alessandro I've been in offline land for a couple of days... 2010/10/11 Alessandro C. cavalieri.alessan...@gmail.com: Following the example of Markus http://using.castleproject.org/display/AR/Using+the+Conversation+Pattern I tried to change my application from single global session to a

Re: Using session per conversation with ActiveRecord

2010-10-20 Thread Markus Zywitza
(() = PlanningProcess.GoAhed(planning)) or using(new ConversationalScope(conversation)) {  PlanningProcess.GoAhed(planning); } and if I understand well I can remove the TransactionScope object because the conversation handles its own transaction is that true? --Alessandro On 19 Ott, 08:32, Markus Zywitza

Re: optimistic or pessimistic locking

2011-02-19 Thread Markus Zywitza
Depends on driver and database. TransactionScope uses IsolationLevel.Unspecified, so there is no locking at all unless you have version properties on your AR classes. As a work-around, you cold specify default IsolationLevel to Serializable in TransactionScope.cs line 99, so the driver uses

Re: ActiveRecord and separation of concerns

2011-02-22 Thread Markus Zywitza
Hi Christian I'd recommend using AutoMapper to map your AR objects to your view models. This is the best solution no matter what persistence framework you are using. You can leave the persistence layer out completely for testing and visual design. DDD fans might even introduce a separated domain

Re: Castle/NHibernate table insert problem.

2011-05-27 Thread Markus Zywitza
Can you post the class please? On Fri, May 27, 2011 at 20:43, scottl2001 scottlackey2...@yahoo.com wrote: Hello all - Having a problem inserting into a new table via Castle/NHibernate. When adding an initial record, it's erroring out, and giving the stack trace listed below. All fields

Re: Castle/NHibernate table insert problem.

2011-05-31 Thread Markus Zywitza
{ _dateLastSold = value; } } #endregion } } * On May 27, 3:47 pm, Markus Zywitza markus.zywi...@gmail.com wrote: Can you post the class please? On Fri, May 27, 2011 at 20:43, scottl2001 scottlackey2

Re: Castle/NHibernate table insert problem.

2011-05-31 Thread Markus Zywitza
it seems the input values are unknown to this new table, wither it is the INSERT I tried earlier, or the ListByProperty iwth an input propertyvalue. Seems perhaps to be a permissions problem, though that doesn't seem to be the case either. I'm stumped. On May 31, 10:29 am, Markus Zywitza

Aw: ActiveRecord Inner Query

2011-06-07 Thread Markus Zywitza
This query is basically select * from tbl_user, in HQL from Users. Your query creates a cross-join about the table, selecting all rows with matching IDs. If ID is a PK, this is simply a select * from tbl_user, because the only matching rows in this cross join are those that match a row to

Aw: Re: Aw: ActiveRecord Inner Query

2011-06-08 Thread Markus Zywitza
You don't understand correctly: AR/NH works upon objects not tables. Without any classes and mappings no one can show you any Criteria or HQL. HQL is quite powerful, see here for example: http://nhforge.org/doc/nh/en/index.html#queryhql-examples Alternatively, if these queries are not part of

ActiveRecord Inner Query

2011-06-08 Thread Markus Zywitza
Then the best bet is creating views from the queries and map those views to readonly viewmodel classes using AR. You can then use all your Oracle server gives you for querying and use AR to load and display the results. -Markus -- You received this message because you are subscribed to the

Aw: castle/nhibernate mapping config problem

2011-06-08 Thread Markus Zywitza
No more hibernate. before the properties since NH 2.0 http://nhforge.org/doc/nh/en/index.html#configuration-xmlconfig -Markus -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web visit

Aw: Problem saving an object created dynamically with reflection

2011-06-10 Thread Markus Zywitza
The exception sounds like it needs an integer id, since [PrimaryKey] is a shortcut for using Identity. You can also try [PrimaryKey(PrimaryKeyType.Assigned)] instead. -Markus -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this

Aw: Re: add new record - HELP!

2011-06-24 Thread Markus Zywitza
What happens if you copy/paste the SQL in SSMS and insert a record there? Do you use assigned IDs, are they generated by NH or the database? --Markus -- You received this message because you are subscribed to the Google Groups Castle Project Users group. To view this discussion on the web

Re: Creating 2 identical foreign key in a table

2012-01-17 Thread Markus Zywitza
Hi that ForeignKey creates a constraint named Country_ID instead of selecting the PK of the referenced table. AFAIR it is used only to name the FK constraint other than FK__table__table__guid. But since these are two different constraints, each name must be named unique. If you not intend to

<    1   2   3