title: Java Spring shedlock fails
body: <p>i have a spring-boot app, which on production environment runs in 2 instances, resulting in scheduled tasks running twice.  to avoid that i'm trying use shedlock, as explained <a href="https://www.baeldung.com/shedlock-spring" rel="nofollow noreferrer">here</a> and <a href="https://github.com/lukas-krecan/ShedLock" rel="nofollow noreferrer">here</a>, but it has no affect.
  i'm already using a MySql db, to which i added a <code>shedlock</code> table as explained on both of the examples above.</p>
  <p>my project's structure is as follows (partially) -</p>
  <p><a href="https://i.stack.imgur.com/FXlFk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FXlFk.png" alt="enter image description here" /></a></p>
  <p>in my <code>application.properties</code> file i have this settings -</p>
  <pre><code>db.driver=com.mysql.cj.jdbc.Driver
  db.url=jdbc:mysql://localhost:3306/b4ad?autoReconnect=true&amp;useSSL=false&amp;useUnicode=true&amp;useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC
  db.username=*****
  db.password=*****
  </code></pre>
  <p>to the <code>AppConfig</code> class i added this annotation -</p>
  <pre><code>@EnableSchedulerLock(defaultLockAtMostFor = &quot;PT30S&quot;)
  </code></pre>
  <p>and this bean -</p>
  <pre><code>@Bean
  public LockProvider lockProvider(DataSource dataSource) {
      return new JdbcTemplateLockProvider(dataSource, &quot;b4ad.shedlock&quot;);
  }
  </code></pre>
  <p>and in the <code>ScheduledManager</code> class i have this scheduled task -</p>
  <pre><code> @Scheduled(cron = &quot;0 0/1 * * * ?&quot;)
  @SchedulerLock(name = &quot;deactivateExpiredOrganizations&quot;, lockAtLeastFor = &quot;PT5M&quot;)
  public void deactivateExpiredOrganizations() {
      // my code...
  }
  </code></pre>
  <p>when i run my application locally on 2 instances (using 2 different ports in the <code>application.properties</code> file), looking at the log i can see that the task runs on both instances, and at the same time the <code>shedlock</code> table remains empty.
  according to the second item in the <a href="https://github.com/lukas-krecan/ShedLock#troubleshooting" rel="nofollow noreferrer">troubleshooting</a> section, it seems that i miss-configured something, but i can't tell what.</p>
  <p>any help will be appreciated.</p>