Re: trigger-identity ID generation

2009-03-30 Thread Gerdus van Zyl
I too need the trigger-identity functionality but for Firebird in my case. On Mar 10, 10:58 pm, smith2martin smith2mar...@gmail.com wrote: I'm using AR latest and Oracle9Dialect with a trigger on my table for sequence-generated IDs. NH2.1.0 has added a newtrigger-identitygenerator which

ActiveRecord AfterLoad Event

2009-05-19 Thread Gerdus van Zyl
Hi, I am looking for an ActiveRecord/NHibernate afterload event to complement the BeforeLoad event. The use case is I have some processing I want to do if the object is changed after load but not during loading from the database. for example a tax calculation that should only be carried out when

ActiveRecord database exception handling

2009-07-20 Thread Gerdus van Zyl
Hi, I have an unique constraint in the database that throws an exception but in handling the exception I have to scope.dispose() and create a new scope otherwise it doesn't seem to send the changes I made to the object to the database and instead sends the old nonworking state. Is this this

Re: ActiveRecord database exception handling

2009-07-20 Thread Gerdus van Zyl
Ah thank you, I understand better now. I would have expected the flush to give an exception if the session is no longer usable. On Mon, Jul 20, 2009 at 1:11 PM, Markus Zywitzamarkus.zywi...@gmail.com wrote: After an NH/AR exception the session cannot be used anymore, so you have to create a

add a validator in constructor

2009-07-20 Thread Gerdus van Zyl
Is there a way to add a validator to an existing property? I have my properties in a class that is generated from the database, so I can't add validators there, then in a class that derives from that generated class I would like to add the validators to existing properties. or if that is not

Re: ActiveRecord AfterLoad Event

2009-07-22 Thread Gerdus van Zyl
In case someone has the same question in the future: PostLoad event on Nhibernate that can be hooked up using the technique in http://using.castleproject.org/display/AR/Using+NHibernate.Search+with+ActiveRecord code: Dim holder As ISessionFactoryHolder =

Re: add a validator in constructor

2009-07-22 Thread Gerdus van Zyl
: Have a look at IsOverride on the Property attribute. This allows you to override an existing property and add validators to it. This may not be possible if your generated class doesn't mark your properties at virtual. Dave. On Jul 20, 1:33 pm, Gerdus van Zyl gerdusvan...@gmail.com wrote

AR Active Record .net 2.0 combatability

2009-07-31 Thread Gerdus van Zyl
will be supported could you please give me the rationale behind it; will make it easier to convince the boss that 3.5 is really necessary :-) Thank You, Gerdus van Zyl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle

AR Winforms sessionscope

2009-08-06 Thread Gerdus van Zyl
Hi, What is the recommended way of using sessionscope in a window form project? (many forms open at once) The solution that came close to working is to have a sessionscope(flushaction.never) on application load and then save within a transactionscope. This did not work since I am getting object

Re: AR Winforms sessionscope

2009-08-06 Thread Gerdus van Zyl
session and transaction per operation. -Markus 2009/8/6 Gerdus van Zyl gerdusvan...@gmail.com Hi, What is the recommended way of using sessionscope in a window form project? (many forms open at once) The solution that came close to working is to have a sessionscope(flushaction.never

Re: AR Winforms sessionscope

2009-08-06 Thread Gerdus van Zyl
-per-thread if you have multiple worker threads. -Markus 2009/8/6 Gerdus van Zyl gerdusvan...@gmail.com I am looking for fine grained last update wins concurrency. If you have two people update the same object but not the same field it should work and if they update the same field the last

Re: AR Winforms sessionscope

2009-08-06 Thread Gerdus van Zyl
a SessionScope: No shared 1st level cache, no dirty checking... -Markus 2009/8/6 Gerdus van Zyl gerdusvan...@gmail.com I have pretty much given up on using a sessionscope or long lived session at all. Currently I just let activerecord create a new scope every time it's needed. Now I just need

Re: AR Winforms sessionscope

2009-08-07 Thread Gerdus van Zyl
Ah ok. Thank you for all the guidance and patience. On Fri, Aug 7, 2009 at 6:08 AM, Markus Zywitzamarkus.zywi...@gmail.com wrote: 2009/8/6 Gerdus van Zyl gerdusvan...@gmail.com Why then does the code below work then? Because you have your own dirty tracking... the parameter previousState

faster startup activerecord nhibernate

2009-09-01 Thread Gerdus van Zyl
] Castle.ActiveRecord.Framework.Internal.ActiveRecordModelBuilder.ProcessProperties [566ms] Nhibernate.Properties.BasicPropertyAccesor.GetGetterOrNul [546ms] Thank you, Gerdus van Zyl [1] http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory-initialization.aspx

Re: Get the session object in castle active record when doing a transaction

2009-09-02 Thread Gerdus van Zyl
I think you need to create a transactionscope yourself like: TransactionScope transaction = new TransactionScope(); then you can use and pass it around as you like. Or what am I missing? And then you need a function like this to get the database connection and enlist it in the transaction:

Re: Get the session object in castle active record when doing a transaction

2009-09-02 Thread Gerdus van Zyl
it working. Have tried a lot but all failed getting an exception. Please help me, thanks a lot. Regards, the.wizard On 2 Sep, 13:50, Gerdus van Zyl gerdusvan...@gmail.com wrote: I think you need to create a transactionscope yourself like: TransactionScope transaction = new TransactionScope

Re: BelongsTo with char foreign key - ActiveRecord/NHibernates assumes int?

2009-09-03 Thread Gerdus van Zyl
I think [HasMany] should look like [ HasMany( typeof(AppAtbs) ) ] ~G On Thu, Sep 3, 2009 at 11:28 AM, JamesLja...@microsec.co.uk wrote: Hi all, I have two tables: CREATE TABLE [SpatialApplications] (        [ApplicationId] [int] IDENTITY (1, 1) NOT NULL ,        [CRN] [char] (8) COLLATE

Re: Get the session object in castle active record when doing a transaction

2009-09-03 Thread Gerdus van Zyl
at transaction.GetSession(transaction), I really confuse what to put as the parameter for GetSession method. Anybody please help me. Thanks a lot. Regards. On 2 Sep, 20:21, Gerdus van Zyl gerdusvan...@gmail.com wrote: The code I gave is probably wrong since it does not use the current session

Re: BelongsTo with char foreign key - ActiveRecord/NHibernates assumes int?

2009-09-03 Thread Gerdus van Zyl
. Thanks for your input - any further thoughts? James On Sep 3, 11:59 am, Gerdus van Zyl gerdusvan...@gmail.com wrote: I think [HasMany] should look like [ HasMany( typeof(AppAtbs) ) ] ~G On Thu, Sep 3, 2009 at 11:28 AM, JamesLja...@microsec.co.uk wrote: Hi all, I have two tables

Re: Get the session object in castle active record when doing a transaction

2009-09-04 Thread Gerdus van Zyl
keyword in VB.NET? Is the link has a VB version? Really thanks a lot Gerdus. Regards. On 3 Sep, 18:04, Gerdus van Zyl gerdusvan...@gmail.com wrote: Just use the code given in the blog (ActiveRecordMediator.Execute) inside ExecSPNonQueryForTransaction and remove the pSession parameter

Re: AR 2.0 WinForms session management

2009-09-09 Thread Gerdus van Zyl
I used to use a SessionScope(FlushAction.Never) and call flush on Save and just do nothing on Cancel. If you have relatively simple forms and only a few forms open at once this works quite well. Having long lived sessions are however not recommended. Also sessionscopes use a stack based model so

Re: AR 2.0 WinForms session management

2009-09-15 Thread Gerdus van Zyl
incorporate that into Castle, but not finding much info at all. On Sep 9, 7:03 am, Gerdus van Zyl gerdusvan...@gmail.com wrote: I used to use a SessionScope(FlushAction.Never) and call flush on Save and just do nothing on Cancel. If you have relatively simple forms and only a few forms open at once

Re: Newbie Question

2009-09-15 Thread Gerdus van Zyl
I think it should be: SimpleQuery query = new SimpleQuery(typeof(User), update User usr set usr.Login= 'Test' ); Case matters and you have to use the defined property name. ~Gerdus On Tue, Sep 15, 2009 at 4:16 PM, Gustavo Melo pipoc...@gmail.com wrote: Thanks Gauthier, But i'm still have a

Re: FindAll and HasMany

2009-09-24 Thread Gerdus van Zyl
I think you are looking for an SimpleQuery (nhibernate query) in that case: http://www.castleproject.org/activerecord/documentation/trunk/usersguide/hql.html eg. FROM Patient p JOIN p.surgeries as s WHERE s.Name LIKE ? ~Gerdus On Fri, Sep 25, 2009 at 2:35 AM, Marc Pickett

Re: FindAll and HasMany

2009-09-25 Thread Gerdus van Zyl
Castle.ActiveRecord.Queries On Fri, Sep 25, 2009 at 1:36 PM, Marc Pickett marcpick...@gmail.com wrote: Yes that looks like exactly what I want. I can't seem to find the SimpleQuery class though. Can you tell me what namespace that is in? On Sep 24, 9:35 pm, Gerdus van Zyl gerdusvan

Lazy Load Question

2009-10-19 Thread Gerdus van Zyl
I have several collections defines as below. Now I am trying to enable lazy loading but the below does not lazy load the collection. I have tried putting ServiceItems as a property (I lose the events) but that does not work either. Any ideas? p.s. DetailList is just a wrapper for the ilist that

Re: Lazy Load Question

2009-10-20 Thread Gerdus van Zyl
Set(ByVal value As IList(Of Db_Serviceitems)) _ilistservitems = value End Set End Property Thanks. ~Gerdus On Mon, Oct 19, 2009 at 12:31 PM, Gerdus van Zyl gerdusvan...@gmail.com wrote: I have several collections defines as below. Now I am trying to enable lazy loading

Re: speed up activerecord initialization

2009-10-22 Thread Gerdus van Zyl
is that something that can be used by a plain activerecord app not using castle? On Wed, Oct 21, 2009 at 10:23 PM, Ayende Rahien aye...@ayende.com wrote: http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory-initialization.aspx On Tue, Oct 20, 2009 at 4:00

Re: speed up activerecord initialization

2009-10-22 Thread Gerdus van Zyl
van Zyl gerdusvan...@gmail.com wrote: is that something that can be used by a plain activerecord app not using castle? On Wed, Oct 21, 2009 at 10:23 PM, Ayende Rahien aye...@ayende.com wrote: http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory