resolveIdleStatus(connectionHandler);
}
}
}
private void resolveIdleStatus(final ConnectionHandler connectionHandler) {
final DatabaseTransactionManager transactionManager = DatabaseTransactionManager.getInstance(getProject());
final ConnectionStatus connectionStatus = connectionHandler.getConnectionStatus();
if (!connectionStatus.isResolvingIdleStatus()) {
final int idleMinutes = connectionHandler.getIdleMinutes();
final int idleMinutesToDisconnect = connectionHandler.getSettings().getDetailSettings().getIdleTimeToDisconnect();
if (idleMinutes > idleMinutesToDisconnect) {
if (connectionHandler.hasUncommittedChanges()) {
connectionHandler.getConnectionStatus().setResolvingIdleStatus(true);
new SimpleLaterInvocator() {
public void execute() {
IdleConnectionDialog idleConnectionDialog = new IdleConnectionDialog(connectionHandler);
idleConnectionDialog.show();
}
}.start();
} else {
transactionManager.execute(connectionHandler, false, TransactionAction.DISCONNECT_IDLE);
}
}
}
}