mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
Close #471 - sync sqlite operations to guard against deadlocks
This commit is contained in:
parent
06e732d8c7
commit
12941ffe62
@ -33,7 +33,7 @@ public class SQLReconnectHandler extends AbstractReconnectManager
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ServerInfo getStoredServer(ProxiedPlayer player)
|
||||
protected synchronized ServerInfo getStoredServer(ProxiedPlayer player)
|
||||
{
|
||||
String server = null;
|
||||
try ( PreparedStatement ps = connection.prepareStatement( "SELECT server FROM players WHERE username = ?" ) )
|
||||
@ -62,7 +62,7 @@ public class SQLReconnectHandler extends AbstractReconnectManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServer(ProxiedPlayer player)
|
||||
public synchronized void setServer(ProxiedPlayer player)
|
||||
{
|
||||
|
||||
try ( PreparedStatement ps = connection.prepareStatement( "UPDATE players SET server = ?, seen = ? WHERE username = ?" ) )
|
||||
@ -83,7 +83,7 @@ public class SQLReconnectHandler extends AbstractReconnectManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
public synchronized void close()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user