Running into an issue with QBCore where my automatic job promotion system updates the database correctly, but the player's cached PlayerData.job values don't refresh. The progression script runs and successfully updates grade_rank in the DB (confirmed in logs), but Player.PlayerData.job.grade still shows the old cached value.
I'm doing something like this:
MySQL.update('UPDATE players SET job = ?, grade = ? WHERE citizenid = ?', {newJob, newGrade, playerCitizenId}, function(affectedRows)
local Player = QBCore.Functions.GetPlayer(source)
-- Database updates successfully but PlayerData.job still shows old values
end)The player has to fully disconnect and reconnect before the new job/grade takes effect. Other players can see the updated job info, but the affected player still gets old permissions and can't access new job features. Is there some cache invalidation step I'm missing after updating the database directly?
Using QBCore 2.0.0 with oxmysql v2.9.5, OneSync Infinity, and the default QBCore player data caching.
MysticRose · 31/08/2026
This is a classic QBCore PlayerData cache desync. Your database update succeeds (grade_rank = 4 in DB) but QBCore's internal PlayerData cache holds the stale values (job.grade = 2). The framework doesn't automatically invalidate its cache when you modify the database directly - it assumes all job changes go through its own methods.
Since you're updating outside the framework's flow, you need to force a PlayerData refresh after your MySQL.update completes. The cache invalidation isn't happening automatically, which explains why other players see the update (they pull fresh data) but the target player remains stuck on cached values until reconnect.
FrostByte · 01/09/2026
Sign in to reply.