What is the use of insertLazy() in GlideRecord?

Pranshu3
Tera Expert

Hi,

I was going through one of the OOB script includes : PerspectiumLogger,
when I came across the use of lgr.insertLazy() for var lgr = new GlideRecord("u_psp_log_message") in log function.

Could you please explain the difference between insertLazy and insert methods in GlideRecord?

Thanks!

3 REPLIES 3

DirkRedeker
Mega Sage

HI Pranshu

This seems to be an undocumented (and maybe legacy) function.

I just can imagine, speaking of logging functions, that the record will not be saved to the DB immediately.

There are other DB Systems on the market, where a "lazy-writer" takes records from the transaction log to the DB file, only when there is no heavy load on the database.

For me, it looks to something like that.

I would recommend NOT to use it in your scripts, as it is undocumented, and I cannot find any useful information on that in the docs, etc.

 

If this answers your questions or is helpful, give me a vote.

BR

Dirk

Hi

 

If you need more information on this issue, just let me know.

If your question was answered with my reply, please mark as correct and close this question.

 

Thanks & BR

Dirk

The SN Nerd
Giga Sage
Giga Sage

You'd need to raise a case on HI to get an official response around this undocumented function.

I've never heard of it before.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022