Thought: Override the SAVE method for the Project. Serialize your
objects to XML, then send the serialized XML to a sproc. Overly
simplistic suggestion, granted, but there's no way to avoid an ORM
doing individual INSERTs for each object.

That being said, how often are you creating such complex projects? If
it's only occasionally, is 2-5 seconds that bad? Does the time to save
really slow down the users, or cause locking problems on the DB?


 - Brian



On Jul 6, 4:05 pm, Michael Yeaney <[email protected]> wrote:
> Question for the AR experts out there.  I'm working with an object hierarchy
> that is (roughly) defined as such:
> Project
> - Has Properties
> - Has Categories
>
> Category
> - Has Properties
> - Has (Sub) Categories
> - Has a type (enum)
>
> Property
> - Has DataItems
> - Has a type (enum)
>
> DataItem
> - Has Name
> - Has InternalName
> - Has Value
> - Has InternalValue
>
> I've got everything working with AR, but the insert implimentation is really
> bothering me. The project object(s) I'm saving to the DB contain 40 - 50
> categories, each with ~100 properties.  As you can probably imagine, this is
> resulting in an * enormous* amount on INSERT's being issued to the DB (over
> the wire), in total taking 2 - 5 seconds.  In the old days, I would have
> hand-rolled this insert to use XML (I'm on SQL Server 2005), and sent the
> entire graph in with one call over the wire.
>
> Has anybody run into this before, and is this "normal"?  It doesn't feel
> good at all...or, is there an AR optimization that I'm not familiar with
> that can help here?
>
> Cheers, and thanks for you time...
> Michael Y.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to