I would recommend that you would use solution 1.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mircea Jivoin
Sent: Sunday, June 18, 2006 11:33 PM
To: [email protected]
Subject: Re: [Castle-users] Use AR to dynamicaly create new table column

 

Ayende, thanks for the response.

I didn't exactly understand which suggestion did you refer?
I've attached two diagrams of my solutions, first is using AR and many-to-many with value and second is one from which I've migrated to AR that used stored procedure that created new property column when a new property was added.

Can you tell me which one is better to use?
I think to proceed with first one, and if you think that there is no performance problem then is no problem.

Many thanks and I'm waiting for your replays

On 6/18/06, Ayende Rahien <[EMAIL PROTECTED]> wrote:

A table with 63 columns is not pretty. I'm going to assume that it is mostly nullable ones, which is even less pretty. Use your first suggestion, you will be happy.

Check NHiberntae caching. There is some info about that. There is a short guide here:

http://www.castleproject.org/index.php/ActiveRecord:How_to:Enable_second_level_cache

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Mircea Jivoin
Sent: Sunday, June 18, 2006 9:26 PM


To: [email protected]
Subject: Re: [Castle-users] Use AR to dynamicaly create new table column

 

That's good to hear, I have a set of 63 properties for each document.
The propertis can change or add in the future so I could't come with other designe to store values for each document property then having a intermediate table for that with many-to-many relation and value.

Can you send me some links for caching the AR results?
Thank you for the resplay.
Mircea

On 6/17/06, Ayende Rahien < [EMAIL PROTECTED]> wrote:

This shouldn't have much effect. I'm using similar methods in several places, and I have not seen any perf problems.

In general, the DB should handle this easily, it is a join and a select, simple stuff mostly.

Throw some caching into the deal, and you will have smooth sailing.

 

How often are you adding a new property, anyway? Does it make sense to have dynamic properties?

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Mircea Jivoin
Sent: Saturday, June 17, 2006 2:39 PM


To: [email protected]
Subject: Re: [Castle-users] Use AR to dynamicaly create new table column

 

Yes is a nasty thing to do.
But my scenario is next:
I have a table of documents, a table of properties and a table of property values.
The initial approach to this was using a stored procedure that created a new column for each new property added in property table.
But when I transferred to the AR I simply mapped as many-to-many with value table.

Now my concern is the table size and it's performance.
Can I go like this with AR map?
The values table will grow like hell, what is your experience with this approach?
Thanks for any comments.
Mircea

On 6/17/06, Ayende Rahien <[EMAIL PROTECTED]> wrote:

I can think of several ways to make it happen, but I can't think of a
scenario where this is a good thing.
Self modifying schema is a near contester to self modifying code in by list
of things that I don't want to work with.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]] On Behalf Of
hammett
Sent: Saturday, June 17, 2006 4:33 AM
To: [email protected]
Subject: Re: [Castle-users] Use AR to dynamicaly create new table column

Hmm, I think this goes beyond what AR (and I dare to say, NHibernate) has to
offer.

On 6/16/06, Mircea Jivoin < [EMAIL PROTECTED]> wrote:
> Hy everyone,
>
> Does anyone know if it is possible to dynamically or somehow in
> run-time create new table column using AR or NHibernate?


--
Cheers,
hammett
http://hammett.castleproject.org/


_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users



_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 




_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 




_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

 

_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to