Skip to content

Commit

Permalink
0001545: Unlock should use symmetricds server time, not database time…
Browse files Browse the repository at this point in the history
…, for consistency.
  • Loading branch information
chenson42 committed Jan 24, 2014
1 parent abaf161 commit e1d23dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -189,7 +189,7 @@ public void unlock(final String action) {

protected boolean unlock(String action, String serverId) {
String lastLockingServerId = serverId.equals(Lock.STOPPED) ? null : serverId;
return sqlTemplate.update(getSql("releaseLockSql"), new Object[] { lastLockingServerId, action,
return sqlTemplate.update(getSql("releaseLockSql"), new Object[] { new Date(), lastLockingServerId, action,
serverId }) > 0;
}

Expand Down
Expand Up @@ -36,7 +36,7 @@ public ClusterServiceSqlMap(IDatabasePlatform platform, Map<String, String> repl

putSql("releaseLockSql",
""
+ "update $(lock) set locking_server_id=null, lock_time=null, last_lock_time=current_timestamp, last_locking_server_id=? "
+ "update $(lock) set locking_server_id=null, lock_time=null, last_lock_time=?, last_locking_server_id=? "
+ " where lock_action=? and locking_server_id=? ");

putSql("insertLockSql", "" + "insert into $(lock) (lock_action) values(?) ");
Expand Down

0 comments on commit e1d23dc

Please sign in to comment.