RE: Updating DB with large collections
From: gwenda (gwenda_at_discussions.microsoft.com)
Date: 10/13/04
- Next message: Sam Santiago: "Re: Updating DB with large collections"
- Previous message: Sam Santiago: "Re: Updating DB with large collections"
- In reply to: gwenda: "Updating DB with large collections"
- Next in thread: Sam Santiago: "Re: Updating DB with large collections"
- Reply: Sam Santiago: "Re: Updating DB with large collections"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 13 Oct 2004 16:03:03 -0700
Hi Sam,
Thanks for your answer. There are few points I would like to point out
regarding your answer:
Generally, I intend to update all the properties of any object. However, I
don’t want to update (if I don’t have to) two types of properties:
Collections –usually contains other objects. I would like to
insert/update/delete only the objects in the collection that were modified by
the client. Some of my objects contain rather large collections and some may
contain more than one property which is a collection.
Large sub-objects – that is an object which is contained in the main object
and is large enough to reconsider updating it for no reason.
Performance is indeed a consideration but another motive was the DB
concurrency. Naturally those sub-objects and collections usually reside in
other tables in the DB and may have been modified but other users. Although I
have a mechanism to prevent it, I’ve learned that those big updates which
wipe everything an re-insert new date usually turn to be messy.
Although the “dirty” flag is a possibility, it is a “dirty” one… :-) And in
case of external systems/other UI that will update my system, I will have to
make sure that the flags were used.
I was thinking about having my business component in the middle tier
comparing the cached object with the modified object. According to the
comparison results the relevant main-object and/or sub-objects and/or
collections objects will be sent to the data layer components. The
collections can be serialized to XML strings and sent to the DB as such. But
this seems like a complex solution to what I imagined should be quite common
problem and I kind of hoped for a “by-the-book” solution.
Thanks Again,
Gwenda
"gwenda" wrote:
> Hi,
> My application is composed of business entities which are in the form of
> classes instances. Some of these entities contains large arraylists of other
> entities. These entities are being sent to the client - where the user might
> add/modify/delete some items in the arraylists. Natuaraly, I don't want to
> send to the DB the part of the entities which the user hadn't changed.
> I'm keeping a copy of the original entity in my middle tier so when the
> modified entity is returned from the client I can check what was changed and
> according to this decide what to send to my data layer.
> The question is what would be the best method to do the comparison?
> I was advised to use dataset. I've tried to serialize my arraylists - both
> of the original object and the modified one - into datasets and use the merge
> method. But I couldn't get it to work (note that the client is not getting a
> dataset but rather a class instance). Is there a way to make it work
> following the above scenario? If there isn't what would be the most
> appropriate way to perform that kind of operation?
> Thanks,
> Gwenda
- Next message: Sam Santiago: "Re: Updating DB with large collections"
- Previous message: Sam Santiago: "Re: Updating DB with large collections"
- In reply to: gwenda: "Updating DB with large collections"
- Next in thread: Sam Santiago: "Re: Updating DB with large collections"
- Reply: Sam Santiago: "Re: Updating DB with large collections"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|