This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 150824 - Not clear message by attempt to delete record with uncommited changes
Summary: Not clear message by attempt to delete record with uncommited changes
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Shansi 11
URL:
Keywords:
Depends on:
Blocks: 152437
  Show dependency tree
 
Reported: 2008-10-21 09:16 UTC by Roman Mostyka
Modified: 2009-02-19 20:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-10-21 09:16:35 UTC
1. Connect to DB.
2. Rightclick some of it's table and choose "View Data".
3. Change value of some cell.
4. Select this cell, rightclick it and choose "Delete Selected Row".

Result: Error message, that there is no matching rows to delete, appears. But it can mislead customer. It isn't clear
from this message why there is no matching rows. Probably if customer wants to delete some row, IDE should refresh data
for it and delete this row.
If it isn't possible, then at least message should contain suggestion that probably record has uncommited changes for
index field.
Comment 1 _ ahimanikya 2008-10-21 09:43:44 UTC
Please remember we are updating a result set or view. Here is how delete the works:

If there is a primary key, it will use the value as part of where condition (delete from table ...where key=value), if
there is no key then all the columns are used in the where condition, in such case a table could have multiple row with
the same value, that triggers to an ambiguous situation. IMO, In this situation the best choice is tell the user that
there is no unique row to matchs the row in subject. 

Most databases does operate the same way, when you try to delete/update an updatable view with ambiguous or duplicate
dataset. Data View is something similar to updatable view.

There could be minor tweak that we could do in the message, to make the message more clear to our user. Please come up
with suggestion if you can...
Comment 2 Roman Mostyka 2008-10-21 10:06:30 UTC
Probably message is the best way.
The problem is that I try to remove record with UNIQUE index (primary key), even with uncommitted changes.
I had 6 records in a table with id from 1 to 6. I added new record with id 7. Then I changed it's id to 8 and tried to
delete. So this row still has unique primary key, but can't be deleted.
In this case the problem is that IDE tries to delete record with changed primary key, but it doesn't exist, since this
change still wasn't committed.
Comment 3 Shansi 11 2008-11-17 12:05:45 UTC
Needs Verification.
http://hg.netbeans.org/main/rev/1d8e3f806f89
Comment 4 Roman Mostyka 2008-11-18 12:09:20 UTC
Verified with build 081117.