Class FHIRDbConnectionStrategyBase

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FHIRDbConnectionStrategyBase​(javax.transaction.TransactionSynchronizationRegistry trxSyncRegistry, Action newConnectionAction)
      Protected constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void applySearchOptimizerOptions​(java.sql.Connection c, boolean isCompartment)
      Apply any optimizer options configured to improve search query performance See issue-1911 for details.
      protected void configure​(java.sql.Connection connection, java.lang.String tenantId, java.lang.String dsId)
      Check with the transaction sync registry to see if this is the first time we've worked with this connection in the current transaction.
      protected java.sql.Connection getConnection​(javax.sql.DataSource datasource, java.lang.String tenantId, java.lang.String dsId)
      Get a connection configured for the given tenant and datasourceId
      FHIRDbFlavor getFlavor()
      Get the flavor of the database we are working with to reveal its capabilities
      java.lang.String getHintValue​(java.lang.String hintProperty)
      Get the hint value from the configuration
      QueryHints getQueryHints()
      Append the given hint to FHIR search queries
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FHIRDbConnectionStrategyBase

        protected FHIRDbConnectionStrategyBase​(javax.transaction.TransactionSynchronizationRegistry trxSyncRegistry,
                                               Action newConnectionAction)
                                        throws FHIRPersistenceDataAccessException
        Protected constructor
        Parameters:
        trxSyncRegistry - the transaction sync registry
        newConnectionAction - actions to apply when a connection is created
        Throws:
        FHIRPersistenceDataAccessException
    • Method Detail

      • configure

        protected void configure​(java.sql.Connection connection,
                                 java.lang.String tenantId,
                                 java.lang.String dsId)
                          throws FHIRPersistenceException
        Check with the transaction sync registry to see if this is the first time we've worked with this connection in the current transaction.
        Parameters:
        connection - the new connection
        tenantId - the tenant to which the connection belongs
        dsId - the datasource in the tenant to which the connection belongs
        Throws:
        FHIRPersistenceException
      • getConnection

        protected java.sql.Connection getConnection​(javax.sql.DataSource datasource,
                                                    java.lang.String tenantId,
                                                    java.lang.String dsId)
                                             throws java.sql.SQLException,
                                                    FHIRPersistenceException
        Get a connection configured for the given tenant and datasourceId
        Parameters:
        datasource -
        tenantId -
        dsId -
        Returns:
        Throws:
        java.sql.SQLException
        FHIRPersistenceException
      • getHintValue

        public java.lang.String getHintValue​(java.lang.String hintProperty)
        Description copied from interface: QueryHints
        Get the hint value from the configuration
        Specified by:
        getHintValue in interface QueryHints
        Returns:
      • applySearchOptimizerOptions

        public void applySearchOptimizerOptions​(java.sql.Connection c,
                                                boolean isCompartment)
        Description copied from interface: FHIRDbConnectionStrategy
        Apply any optimizer options configured to improve search query performance See issue-1911 for details.
        Specified by:
        applySearchOptimizerOptions in interface FHIRDbConnectionStrategy
        Parameters:
        c - the connection to be configured
        isCompartment - true if the query is a compartment-based search