Pass SQL connection into nested method to prevent deadlock.
Discussed with Sam on Slack 11 Dec #general.
This commit is contained in:
parent
337f9e4fd9
commit
e107c0a64a
@ -163,11 +163,11 @@ public class SnapshotRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<SnapshotMetadata> getSnapshotMetadata(int snapshotId)
|
public CompletableFuture<SnapshotMetadata> getSnapshotMetadata(Connection connection, int snapshotId)
|
||||||
{
|
{
|
||||||
CompletableFuture<SnapshotMetadata> future = CompletableFuture.supplyAsync(() ->
|
CompletableFuture<SnapshotMetadata> future = CompletableFuture.supplyAsync(() ->
|
||||||
{
|
{
|
||||||
try (Connection connection = DBPool.getAccount().getConnection())
|
try
|
||||||
{
|
{
|
||||||
try (PreparedStatement statement = connection.prepareStatement(GET_METADATA))
|
try (PreparedStatement statement = connection.prepareStatement(GET_METADATA))
|
||||||
{
|
{
|
||||||
|
@ -372,7 +372,7 @@ public class ReportRepository
|
|||||||
if (!resultSet.wasNull())
|
if (!resultSet.wasNull())
|
||||||
{
|
{
|
||||||
SnapshotMetadata snapshotMetadata = _reportManager.getSnapshotManager().getRepository()
|
SnapshotMetadata snapshotMetadata = _reportManager.getSnapshotManager().getRepository()
|
||||||
.getSnapshotMetadata(snapshotId).join();
|
.getSnapshotMetadata(connection, snapshotId).join();
|
||||||
|
|
||||||
report.setSnapshotMetadata(snapshotMetadata);
|
report.setSnapshotMetadata(snapshotMetadata);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user