Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VIVO 3828: Remove SDB in preparation to moving to new Jena.
The Jena version being switched to (Jena 4) removed SDB. The `DatasetWrapperFactory` and `StaticDatasetFactory` should no longer be needed. These seems to exist only to provide SDB specific functionality. The code is simplified a little with the removal of these. The `DatasetFactory.createMem()` function is replaced with `DatasetFactory.createGeneral()`. This serves several purposes: 1) The method is deprecated. 2) The `DatasetFactory.createGeneral()` is the compatible equivalent. 3) The `DatasetFactory.createGeneral()` better supports TDB (which is the main reason for including in this commit set). 4) This better prepares the code for the upcoming Jena upgrade changes. The documentation for `example.runtime.properties` refers to `VitroConnection.DataSource.*` only being used by SDB but this is incorrect. The OpenSocial code appears to talk directly to an SQL database using these properties. Update the documentation in this regard and replace the references to SDB with OpenSocial. Remove no longer necessary SDB helper code that is added to TDB as well because it "shouldn't hurt". Remove much of the documentation and installation functionality using or referencing SDB. The `IndividualDaoSDB.java` file is implemting `getAllIndividualUris()` and `getUpdatedSinceIterator()` via the now removed `IndivdiualSDB` class. This functionality is used by `RebuildIndexTask` and `UpdateUrisTask` classes. Additional investigation is needed to review and determine if the SDB related code needs to be re-implemented in `IndividualDaoJena`. This commit does not address this concern. I originally removed the close command and replaced the dataset wrapper with just the dataset itself. My reasoning is that the previous code is only closing the connection when the SDB has a connection. When using TDB, this should ba a no-op and the close is never called. After further thought, I concluded that it makes more sense to properly and consistently close the connection. The code now explicitly calls the dataset close function. Additional problems in the tests appeared that suggested dataset closure problems and race conditions. The changes to using dataset have therefore been revertted and the `DatasetWrapper` has been retroactively added back. The dataset wrapper has been observed to be used for assisting in closing the Dataset. The `Dataset` is an interface and cannot be easily extended without some wrapper or helper. I considered and tried using a helper utility for preventing an already closed exception on close. This is simpler and easier to maintain. This did not solve the test failure closure problems and race conditions and is not implemented within this commit. The DatasetWrapper itself has the actual dataset closure removed. This is done because theoretically the SDB connection is NULL for non-SDB cases such as with TDB. Because this is always NULL the `dataset.close()` never gets called. This effectively reverts back to my original concept of removing the close command as mentioned above.
- Loading branch information