Class ResourceReferenceDAO

  • All Implemented Interfaces:
    IResourceReferenceDAO, AutoCloseable
    Direct Known Subclasses:
    Db2ResourceReferenceDAO, DerbyResourceReferenceDAO, PostgresResourceReferenceDAO

    public abstract class ResourceReferenceDAO
    extends Object
    implements IResourceReferenceDAO, AutoCloseable
    DAO to handle maintenance of the local and external reference tables which contain the relationships described by "reference" elements in each resource (e.g. Observation.subject). The DAO uses a cache for looking up the ids for various entities. The DAO can create new entries, but these can only be used locally until the transaction commits, at which point they can be consolidated into the shared cache. This has the benefit that we reduce the number of times we need to lock the global cache, because we only update it once per transaction. For improved performance, we also make use of batch statements which are managed as member variables. This is why it's important to close this DAO before the transaction commits, ensuring that any outstanding DML batched but not yet executed is processed. Calling close does not close the provided Connection. That is up to the caller to manage. Close does close any statements which are opened inside the class.