I've been using Exposed and I'm trying to find a way to persist eager loaded values outside of a transaction
NOTE: References that are eagerly loaded are stored inside the Transaction Cache, this means that they are not available in other transactions and thus must be loaded and referenced inside the same transaction.
I found a way by creating a delegate that proxies Reference and caches the value but ran into an issue with eager loading due to refection checks here:
I was curious if we could make Reference and OptionalReference open classes so I can create the cached delegate a Reference and reuse eager loading. I believe the change would be similar to #818. I'm more than happy to make a PR since it seems small enough but wanted to run it by ya'll first or get a second opinion on how to persist references outside of a transaction.
Hello!
I've been using Exposed and I'm trying to find a way to persist eager loaded values outside of a transaction
I found a way by creating a delegate that proxies
Reference
and caches the value but ran into an issue with eager loading due to refection checks here:https://github.com/JetBrains/Exposed/blob/98bdca8a1563a34af9d3d7a357c9b0c0f5fae7e3/exposed-dao/src/main/kotlin/org/jetbrains/exposed/dao/References.kt#L111
I was curious if we could make
Reference
andOptionalReference
open classes so I can create the cached delegate aReference
and reuse eager loading. I believe the change would be similar to #818. I'm more than happy to make a PR since it seems small enough but wanted to run it by ya'll first or get a second opinion on how to persist references outside of a transaction.Thank you