I am using sqlite3 along with drbd. I found the primary key for the table is
inserted twice and the UNIQUE attribute of the table is also not unique.

The application is inserting the objects into the table, and the machine got
rebooted. After coming up from reboot, when i looked into the database i am
seeing a duplicate rows inserted into the database. can you please explain
us what could have been the reason for getting duplicate entries in the
database..

The table is created with the following syntax
CREATE TABLE objects (obj_id integer primary key, class_id integer, dn text,
last_ccb integer);
CREATE UNIQUE INDEX objects_idx on objects (dn);

case 1:

INSERT INTO "objects"
VALUES(1307,155,'entryId=60,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1308,155,'entryId=61,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1309,155,'entryId=62,tableId=CPGMembersTable,CSId=1',0);
<===============
INSERT INTO "objects"
VALUES(1310,155,'entryId=63,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1311,155,'entryId=64,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1312,155,'entryId=65,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1313,155,'entryId=66,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1314,155,'entryId=67,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1315,155,'entryId=68,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1309,155,'entryId=99,tableId=CPGMembersTable,CSId=1',0);
<==================
INSERT INTO "objects"
VALUES(1310,118,'externalMediaFunctionMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1311,115,'fileOutputId=1,statisticalCounterMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1312,114,'filterId=1,ldapId=1,ldapAuthenticationMethodId=1',0);
INSERT INTO "objects" VALUES(1313,111,'fmAlarmModelId=CW,fmId=1',0);


The following entries pointed by the arrow are duplicated.

case 2:

even though the  specified  dn is unique duplicate entries are being present
in the database

a)
INSERT INTO "objects"
VALUES(1309,155,'entryId=99,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1310,118,'externalMediaFunctionMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1311,115,'fileOutputId=1,statisticalCounterMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1312,114,'filterId=1,ldapId=1,ldapAuthenticationMethodId=1',0);
INSERT INTO "objects" VALUES(1313,111,'fmAlarmModelId=CW,fmId=1',0);
INSERT INTO "objects" VALUES(1314,111,'fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1315,110,'fmAlarmTypeId=ComSaAmfComponentCleanupFailed,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1316,110,'fmAlarmTypeId=ComSaAmfComponentInstantiationFailed,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1317,110,'fmAlarmTypeId=ComSaAmfSiUnassigned,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1318,110,'fmAlarmTypeId=ComSaCLMClusterNodeUnavailable,fmAlarmModelId=CW,fmId=1',0);
INSERT INTO "objects"
VALUES(1319,110,'fmAlarmTypeId=ComSaProxyStatusOfAComponentChangedToUnproxied,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects" VALUES(1320,113,'fmId=1',18);
INSERT INTO "objects"
VALUES(1321,109,'folderQuotaInfoId=ACS_DATA,systemSupervisionMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1322,109,'folderQuotaInfoId=ACS_LOGS,systemSupervisionMId=1,safApp=safImmService',0);

b)
INSERT INTO "objects"
VALUES(1360,155,'entryId=99,tableId=CPGMembersTable,CSId=1',0);
INSERT INTO "objects"
VALUES(1361,118,'externalMediaFunctionMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1362,115,'fileOutputId=1,statisticalCounterMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1363,114,'filterId=1,ldapId=1,ldapAuthenticationMethodId=1',0);
INSERT INTO "objects" VALUES(1364,111,'fmAlarmModelId=CW,fmId=1',0);
INSERT INTO "objects" VALUES(1365,111,'fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1366,110,'fmAlarmTypeId=ComSaAmfComponentCleanupFailed,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1367,110,'fmAlarmTypeId=ComSaAmfComponentInstantiationFailed,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1368,110,'fmAlarmTypeId=ComSaAmfSiUnassigned,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects"
VALUES(1369,110,'fmAlarmTypeId=ComSaCLMClusterNodeUnavailable,fmAlarmModelId=CW,fmId=1',0);
INSERT INTO "objects"
VALUES(1370,110,'fmAlarmTypeId=ComSaProxyStatusOfAComponentChangedToUnproxied,fmAlarmModelId=coreMw,fmId=1',0);
INSERT INTO "objects" VALUES(1371,113,'fmId=1',0);
INSERT INTO "objects"
VALUES(1372,109,'folderQuotaInfoId=ACS_DATA,systemSupervisionMId=1,safApp=safImmService',0);
INSERT INTO "objects"
VALUES(1373,109,'folderQuotaInfoId=ACS_LOGS,systemSupervisionMId=1,safApp=safImmService',0);

Here the dn name is unique but still i am seeing duplicate dn names.


-Neelakanta
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to