baan_fun
9th February 2009, 16:54
Hi,
Does somebofy knows how could I catch the error when an audit file is locked for read (I have an interface that exports records logged i nthe audit but when a user is updaing the audited table, the file sequesce is locked for read/write and the interface ends with message "Audit File is locked. Try again?).
The part of my script is :
seq_hdr_size = aud_get_hdr_size(seq_id)
alloc.mem(seq_hdr, seq_hdr_size)
ret = aud_read_seq_hdr(seq_id, seq_hdr )
if ret <> -1 then
|** Should be ok ***
term_status = aud_get_seq_status(seq_hdr)
if term_status = 0 then | Success!
if not e then |di07
lock.step = 0 |di07
break
else
if e = 253 and lock.step < 10 then |File is locked
i = i - 1 lock.step = lock.step + 1 continue
endif
endif
endif
if (bit.and (term_status,AUD_TERM_MAX_SIZE)) then
#ifdef DEBUG
message ("termination because of reaching max size audit %s", tnam)
#endif
endif
if (bit.and (term_status,AUD_TERM_DD_CHGD)) then
#ifdef DEBUG
message("Termination because of dd change ")
#endif
endif
if (bit.and (term_status, AUD_TERM_USER_FRCD ) ) then
#ifdef DEBUG
message("termination forced by user")
#endif
endif
if (bit.and (term_status, AUD_TERM_CORRUPT) ) then
critical = 1
message("file is corrupt audit %s", tnam)
endif
if (bit.and (term_status, AUD_SEQ_REMOVED ) ) then
message("sequence was removed audit %s", tnam)
endif
else
critical = 1
message("Error ... couldn't read sequence header audit %s", tnam)
endif
Thank you in advance for your tip.
Regards,
baan_fun
Does somebofy knows how could I catch the error when an audit file is locked for read (I have an interface that exports records logged i nthe audit but when a user is updaing the audited table, the file sequesce is locked for read/write and the interface ends with message "Audit File is locked. Try again?).
The part of my script is :
seq_hdr_size = aud_get_hdr_size(seq_id)
alloc.mem(seq_hdr, seq_hdr_size)
ret = aud_read_seq_hdr(seq_id, seq_hdr )
if ret <> -1 then
|** Should be ok ***
term_status = aud_get_seq_status(seq_hdr)
if term_status = 0 then | Success!
if not e then |di07
lock.step = 0 |di07
break
else
if e = 253 and lock.step < 10 then |File is locked
i = i - 1 lock.step = lock.step + 1 continue
endif
endif
endif
if (bit.and (term_status,AUD_TERM_MAX_SIZE)) then
#ifdef DEBUG
message ("termination because of reaching max size audit %s", tnam)
#endif
endif
if (bit.and (term_status,AUD_TERM_DD_CHGD)) then
#ifdef DEBUG
message("Termination because of dd change ")
#endif
endif
if (bit.and (term_status, AUD_TERM_USER_FRCD ) ) then
#ifdef DEBUG
message("termination forced by user")
#endif
endif
if (bit.and (term_status, AUD_TERM_CORRUPT) ) then
critical = 1
message("file is corrupt audit %s", tnam)
endif
if (bit.and (term_status, AUD_SEQ_REMOVED ) ) then
message("sequence was removed audit %s", tnam)
endif
else
critical = 1
message("Error ... couldn't read sequence header audit %s", tnam)
endif
Thank you in advance for your tip.
Regards,
baan_fun