Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Intermediate saves in Application logging

Former Member
0 Kudos
187

Hi there,

I try to use application logging in a long running report modyfing a large number of objects (100.000s) each modification writing one, two or sometimes more log entries.

Since I do not want to burden the memory with too large an application log object I thought of flushing the data every now and then to the database, remove them from main memory and continue logging. Another issue with the whole log object in main memory is the one when the report crashes for whatever reason all logs are lost.

Technically I do

  • BAL_LOG_CREATE
  • BAL_LOG_MSG_ADD a (large) number of times
  • BAL_DB_SAVE with explicit handle
  • BAL_LOG_MSG_DELETE_ALL to get rid of the saved messages but retain the header
  • BAL_LOG_MSG_ADD a (large) number of times
  • ...
  • BAL_DB_SAVE

Sadly this updates the log in the database with the last log handle content and does not add the yet unsaved logs to the existing ones.

Does someone maybe know if incremental saving is somehow possible under one log header?

kind regards,

anton

1 REPLY 1

PeterJonker
Active Contributor
0 Kudos
96

maybe using BAL_DB_SEARCH en BAL_DB_LOAD see report SBAL_DEMO_05