Added closes to connections in RepositoryBase that use DataSource.
This commit is contained in:
parent
c15c6e2dd8
commit
90dbd64b17
@ -161,6 +161,16 @@ public abstract class RepositoryBase implements Listener
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (DataSource != null)
|
||||
_connection.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return affectedRows;
|
||||
@ -203,6 +213,16 @@ public abstract class RepositoryBase implements Listener
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (DataSource != null)
|
||||
_connection.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,6 +260,16 @@ public abstract class RepositoryBase implements Listener
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (DataSource != null)
|
||||
_connection.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +344,7 @@ public abstract class RepositoryBase implements Listener
|
||||
@EventHandler
|
||||
public void validateConnection(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.MIN_02)
|
||||
if (event.getType() != UpdateType.MIN_02 || DataSource != null)
|
||||
return;
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(Plugin, new Runnable()
|
||||
|
Loading…
Reference in New Issue
Block a user