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
|
@Override
|
||||||
protected ServerInfo getStoredServer(ProxiedPlayer player)
|
protected synchronized ServerInfo getStoredServer(ProxiedPlayer player)
|
||||||
{
|
{
|
||||||
String server = null;
|
String server = null;
|
||||||
try ( PreparedStatement ps = connection.prepareStatement( "SELECT server FROM players WHERE username = ?" ) )
|
try ( PreparedStatement ps = connection.prepareStatement( "SELECT server FROM players WHERE username = ?" ) )
|
||||||
@ -62,7 +62,7 @@ public class SQLReconnectHandler extends AbstractReconnectManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setServer(ProxiedPlayer player)
|
public synchronized void setServer(ProxiedPlayer player)
|
||||||
{
|
{
|
||||||
|
|
||||||
try ( PreparedStatement ps = connection.prepareStatement( "UPDATE players SET server = ?, seen = ? WHERE username = ?" ) )
|
try ( PreparedStatement ps = connection.prepareStatement( "UPDATE players SET server = ?, seen = ? WHERE username = ?" ) )
|
||||||
@ -83,7 +83,7 @@ public class SQLReconnectHandler extends AbstractReconnectManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close()
|
public synchronized void close()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user