rsim / oracle-enhanced

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

Lazy load type mappings #2296

Closed andynu closed 2 years ago

andynu commented 2 years ago

This appears to fix issue #2256. I believe it should have the same memory implications as the intention in #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.

andynu commented 2 years ago

This fixes the new test case. And works in my applications. Unfortunately, it also triggers some other test failures. Sadly, without being able to reproduce your test environment locally (https://github.com/yahonda/rails-dev-box/issues/43), I do not have the means to pursue the other test failures.

yahonda commented 2 years ago

Would you create a pull request to master branch first? I'll backport it to release70 branch if necessary.

andynu commented 2 years ago

Sure. #2300