当前位置: 动力学知识库 > 问答 > 编程问答 >

Facing issue while using log4j for DB logging

问题描述:

I am using Log4j for logging into database. I am inserting records into 2 different tables which have parent child relationship. DB tables have constraint on them that unless and until a record inserted in parent table, there cant be child record in another table with for that parent.

But when my application run & start logging into DB, log4j does this logging asynchronously & it doesn't maintain the priority for logging. Hence it end up in inserting record in child table first, which result in error.

Can anyone tell me how to resolve this error or set priority for the insert statements?

分享给朋友:
您可能感兴趣的文章:
随机阅读: