rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
545 stars 308 forks source link

Lazy load type mappings #2300

Closed andynu closed 2 years ago

andynu commented 2 years ago

(This time against the master branch)

This appears to fix issue https://github.com/rsim/oracle-enhanced/issues/2256. I believe it should have the same memory implications as the intention in https://github.com/rsim/oracle-enhanced/pull/2199. The type maps are loaded once when they are first called. Only one instance of the mapping is ever created.

Fortunately this was enough to solve the problem, but if there were a need, this could easily be worked into the clear_cache! API to reset it at a later point in the application just by setting the @type_map to nil.

yahonda commented 2 years ago

Would you also change your branch based on the current master branch? It looks this pull request is trying to merge something from release7-0 branch with your commits to the master branch.

andynu commented 2 years ago

Cleaner version without the no-op release70 commits mixed in here: #2301