please provide more info:
1. what version of Caché are you testing? any recent changes to the system?
2. do the errors relate to delete via SQL or objects, or just from normal MV DELETE?
3. do the triggers work for some records/files, but not others? any pattern
4. perhaps send copies of you trigger subroutines (I can give you my email if you don’t want to make them public)
--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
---
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
InterSystems-...@googlegroups.com.
To post to this group, send email to
InterSy...@googlegroups.com.
Visit this group at http://groups.google.com/group/InterSystems-MV.
For more options, visit https://groups.google.com/groups/opt_out.
1. Cache for Windows (x86-64) 2009.1.3 (Build 704_0_10426) Tue Apr 12 2011 03:54:57 GMTDT
2. MV DELETE
3. the trigger is sporadic at best. sometimes it will copy everything correctly, sometimes nothing is written at all, other times the triggered item is created but there is nothing in it. From 5k+ records in a single day appr 1500 missing records, 1000 incorrect records
4.
SUBROUTINE SUB.DELETE.TRANS.REVIEW(FV, EVENT, PRERC, FLAGS, ID, REC, USERRC)
COM PACS,PGM,SCREEN(10),LEVEL,CTRL,COMNUM,VALUES
EQU POSTOPEN TO 1
EQU PREREAD TO 2
EQU POSTREAD TO 3
EQU PREDELETE TO 4
EQU POSTDELETE TO 5
EQU PRECLEAR TO 6 ;* CLEARFILE
EQU POSTCLEAR TO 7
EQU PREWRITE TO 8
EQU POSTWRITE TO 9
EQU PREINSERT TO 10
EQU POSTINSERT TO 11
EQU PREUPDATE TO 12
EQU POSTUPDATE TO 13
READ OLDREC FROM FV,ID ELSE OLDREC = ""
IF UNASSIGNED(^TRANS.REVIEW.BACKUP) THEN
EXECUTE "CREATE-FILE TRANS.REVIEW.BACKUP" CAPTURING MSGS
END
IF ASSIGNED(PGM) THEN
EVENTDESC = PGM<LEVEL>
END ELSE
EVENTDESC = "UNKNOWN"
END
REC = OLDREC
REC<21> = DATE()
REC<22> = OCONV(TIME(),"MT")
REC<23> = @USER
REC<24> = EVENTDESC
^TRANS.REVIEW.BACKUP(ID) = REC
RETURN
it is pre-delete only and the only trigger on the file. when we pulled the data backup to compare the triggered info v the backup info that is there the missing/incorrect record info came from
3. the trigger is sporadic at best. sometimes it will copy everything correctly, sometimes nothing is written at all, other times the triggered item is created but there is nothing in it. From 5k+ records in a single day appr 1500 missing records, 1000 incorrect records
I am nervous about the CREATE-FILE in the trigger.
If 2 users do a DELETE at the same time and the file does not exist, the first will create the file’s VOC entry pointing to the expected global, but the second would see that the global was in use and so assign a different global to store the data.
For example, the second CREATE-FILE would do something like this (note attribute 2):
MV:;^junk=123
MV:CREATE-FILE junk
[421] DICT for file 'junk' created. Type = INODE
[418] Default data section for file 'junk' created. Type = INODE
[437] Added default record '@ID' to 'DICT junk'.
[417] CreateFile Completed.
MV:CT VOC junk
junk
0001 F
0002 ^D.4
0003 ^DICT.junk
0004
0005
0006
0007
0008
0009
0010
MV:
Can you use a different approach to assure that TRANS.REVIEW.BACKUP always exists? Or does it, so this does not matter?
true, but if the last CREATE-FILE left the VOC with a bad file pointer (like mine), then normal MV READs would look at the wrong global
but, that does not sound like this problem since his reads get mixed results