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?