You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding 2 layers of control to prevent locks in SQL DB and minor clean up (#1050)
* Adding 2 layers of SQL DB security and minor clean up
* Removed the commented `enableWriteAheadLogging`
* No need for this as this allows concurrent read and writes to occur and we would rather pause a read while a write occurs
* Pausing will ensure that we are querying the most updated data
* 2 layers of security for SQL DB regarding `OSInAppMessageRepository.java`
* First one will be transactions using `beginTransaction`, `setTransactionSuccessful`, and `endTransaction` methods wherever we `insert`, `delete`, or `update`
* Second one is keeping TABLE manipulation or reading within the same file and setting these methods as synchronized so that any other TABLE touching that occurs won't happen till any current methods are complete
* The combination of the two steps should help prevent any conflicts between SQL DB and solve the locking issues
* WIP - Making sure any DB reading and writing is from the same file so `synchronized` along with transactions provide this 2 layer security around our single SQL DB instance
* Forgot to change `Throwable` to `SQLException` instead
* Fixed within `OSInAppMessageRepository.java`
* Using singleton `OSInAppMessageController.java` instead of new
* Created singleton based `getInAppMessageRepository` method inside of `OSInAppMessageController.java` class
* This allows the synchronized to apply to multiple methods being called from the class instance
* Deleted unused thread name since new Thread was moved toi cache cleaning file with different thread name now
* Needed to change defaults again for `getStringSet`
* `OneSignalCacheCleaner.java` was rearranged a bit and it caused conflicts
* `OSInAppMessageRepository.java` now has those correct changes an the default was flipped `OSUtils.<String>newConcurrentSet()` to `null`
0 commit comments