Class UpdateLockRowSemaphore

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

    public class UpdateLockRowSemaphore
    extends DBSemaphore
    Provide thread/resource locking in order to protect resources from being altered by multiple threads at the same time using a db row update.

    Note: This Semaphore implementation is useful for databases that do not support row locking via "SELECT FOR UPDATE" type syntax, for example Microsoft SQLServer (MSSQL).

    • Constructor Detail

      • UpdateLockRowSemaphore

        public UpdateLockRowSemaphore()
    • Method Detail

      • 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
      • getUpdateLockRowSQL

        protected java.lang.String getUpdateLockRowSQL()
      • setUpdateLockRowSQL

        public void setUpdateLockRowSQL​(java.lang.String updateLockRowSQL)