Class PostgreSQLDialect

    • Constructor Detail

      • PostgreSQLDialect

        public PostgreSQLDialect()
    • Method Detail

      • createUpdateStateStmt

        protected java.sql.PreparedStatement createUpdateStateStmt​(java.sql.Connection c,
                                                                   int max)
                                                            throws java.sql.SQLException
        Specified by:
        createUpdateStateStmt in class AbstractSqlDialect
        Throws:
        java.sql.SQLException
      • createDequeueStmt

        protected java.sql.PreparedStatement createDequeueStmt​(java.sql.Connection c,
                                                               java.lang.String ppoolId,
                                                               int max)
                                                        throws java.sql.SQLException
        Specified by:
        createDequeueStmt in class AbstractSqlDialect
        Throws:
        java.sql.SQLException
      • createDeleteStaleResponsesStmt

        protected java.sql.PreparedStatement createDeleteStaleResponsesStmt​(java.sql.Connection c,
                                                                            int MAX_ROWS)
                                                                     throws java.sql.SQLException
        Specified by:
        createDeleteStaleResponsesStmt in class AbstractSqlDialect
        Throws:
        java.sql.SQLException
      • getDialectDescription

        public java.lang.String getDialectDescription()
      • createQueryAllActiveStmt

        protected java.sql.PreparedStatement createQueryAllActiveStmt​(java.sql.Connection c,
                                                                      java.lang.String className,
                                                                      int max)
                                                               throws java.sql.SQLException
        Specified by:
        createQueryAllActiveStmt in class AbstractSqlDialect
        Throws:
        java.sql.SQLException
      • doLock

        protected void doLock​(java.sql.Connection con,
                              java.lang.String lockContext)
                       throws java.sql.SQLException
        ref: https://www.postgresql.org/docs/9.5/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS pg_advisory_lock locks an application-defined resource, which can be identified either by a single 64-bit key value or two 32-bit key values (note that these two key spaces do not overlap). If another session already holds a lock on the same resource identifier, this function will wait until the resource becomes available. The lock is exclusive. Multiple lock requests stack, so that if the same resource is locked three times it must then be unlocked three times to be released for other sessions' use. DO NOT USE IT WITHOUT finally { release_lock(lockContext)} or it will be deadlocked!!
        Overrides:
        doLock in class AbstractSqlDialect
        Parameters:
        con - connection object on which the lock will be acquired on
        lockContext - String for the lock name (Will be transformed to an int by AbstractSqlDialect.computeLockId(String).
        Throws:
        java.sql.SQLException - If anything goes wrong in acquiring the lock on the database
      • restartFiltered

        public void restartFiltered​(org.copperengine.management.model.WorkflowInstanceFilter filter,
                                    java.sql.Connection con)
                             throws java.lang.Exception
        Specified by:
        restartFiltered in interface DatabaseDialect
        Overrides:
        restartFiltered in class AbstractSqlDialect
        Throws:
        java.lang.Exception
      • queryAuditTrailInstances

        public java.util.List<org.copperengine.management.model.AuditTrailInfo> queryAuditTrailInstances​(org.copperengine.management.model.AuditTrailInstanceFilter filter,
                                                                                                         java.sql.Connection con)
                                                                                                  throws java.sql.SQLException
        Specified by:
        queryAuditTrailInstances in interface DatabaseDialect
        Overrides:
        queryAuditTrailInstances in class AbstractSqlDialect
        Throws:
        java.sql.SQLException