Class StdRowLockSemaphore

  • All Implemented Interfaces:
    Constants, Semaphore, StdJDBCConstants, TablePrefixAware

    public class StdRowLockSemaphore
    extends DBSemaphore
    Internal database based lock handler for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time.
    Author:
    jhouse
    • Constructor Detail

      • StdRowLockSemaphore

        public StdRowLockSemaphore()
      • StdRowLockSemaphore

        public StdRowLockSemaphore​(java.lang.String tablePrefix,
                                   java.lang.String schedName,
                                   java.lang.String selectWithLockSQL)
    • Method Detail

      • setMaxRetry

        public void setMaxRetry​(int maxRetry)
      • setRetryPeriod

        public void setRetryPeriod​(long retryPeriod)
      • getMaxRetry

        public int getMaxRetry()
      • getRetryPeriod

        public long getRetryPeriod()
      • executeSQL

        protected void executeSQL​(java.sql.Connection conn,
                                  java.lang.String lockName,
                                  java.lang.String expandedSQL,
                                  java.lang.String expandedInsertSQL)
                           throws LockException
        Execute the SQL select for update that will lock the proper database row.
        Specified by:
        executeSQL in class DBSemaphore
        Throws:
        LockException
      • getSelectWithLockSQL

        protected java.lang.String getSelectWithLockSQL()
      • setSelectWithLockSQL

        public void setSelectWithLockSQL​(java.lang.String selectWithLockSQL)