I've a problem,
I've put database in SERIALIZABLE mode to avoid mistake when reading records, but redbean's caching get me in trouble,
I use to start transaction, read record do the job and save record, even if I've already read the record I read it again in
transaction if I need to change it, particulary if I need to make operations on datas (+,-,* etc) . This way since I am in
in transaction I'm sure that all operation is done correctly.
But with redbean caching if I've already read the record, when I read it again in transaction the query is not run (it's
the goal of caching) so the record is not locked in database when I do the transaction, this can produce incoherence
in database.
To prevent I have put useWriterCache to false, but this reduce performances.
I think the best will be to clear cache at the begin of a transaction, so futher reading will lock records on database.
Does it possible to clear cache queries ? Can we call a function at each begin transaction ?