Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> minimizing contact with the database

minimizing contact with the database

From: karl wettin <wettin_at_users.sourceforge.net>
Date: Thu, 8 May 2003 07:57:30 +0200
Message-ID: <20030508075730.466145da.wettin@users.sourceforge.net>

I'm trying to minimize the contact with my RDBMS from my application, only updating, inserting and removing entries that needs to be touched.

My problem is when I have an unlimited sized list of attributes associated with a table. Example:

MyClass:
|| PK || ...

MyClass_attribute:
|| MyClassFK || attribute ||

At commit-time, I know the value of attributes have been added and removed, but the attribute isn't unique and there might be duplicates. I can't just pass a "DELETE FROM ... WHERE MyClassFK=n AND attribute=x", since that might remove more than the one attribute I had in mind.

I want to solve this in the buisness layer, not in the persistent layer, thus I don't want to extend MyClass_attribute with unique PK:s.

One solution would be to check if there are any duplicates when I gather the attributes from the persistent layer. If none, it safe to pass above query. If there are duplicates, and any duplicate has been touched, I have to remove ALL attributes and then insert them again.

Are there any better solutions?

karl Received on Thu May 08 2003 - 00:57:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US