/** * INTERNAL: * Called by beginTransaction() to start a transaction. * This starts a real database transaction. * Allows retry if the connection is dead. */ protected void basicBeginTransaction(Accessor accessor) throws DatabaseException { try { accessor.beginTransaction(this); } catch (DatabaseException databaseException) { // Retry if the failure was communication based? (i.e. timeout, database down, can no longer ping) if ((!getDatasourceLogin().shouldUseExternalTransactionController()) && databaseException.isCommunicationFailure()) { DatabaseException exceptionToThrow = databaseException; Object[] args = new Object[1]; args[0] = databaseException; log(SessionLog.INFO, SessionLog.TRANSACTION, "communication_failure_attempting_begintransaction_retry", args, null); // Attempt to reconnect connection. exceptionToThrow = retryTransaction(accessor, databaseException, 0, this); if (exceptionToThrow == null) { // Retry was a success. return; } handleException(exceptionToThrow); } else { handleException(databaseException); } } catch (RuntimeException exception) { handleException(exception); } }
/** * INTERNAL: * Called by beginTransaction() to start a transaction. * This starts a real database transaction. * Allows retry if the connection is dead. */ protected void basicBeginTransaction(Accessor accessor) throws DatabaseException { try { accessor.beginTransaction(this); } catch (DatabaseException databaseException) { // Retry if the failure was communication based? (i.e. timeout, database down, can no longer ping) if ((!getDatasourceLogin().shouldUseExternalTransactionController()) && databaseException.isCommunicationFailure()) { DatabaseException exceptionToThrow = databaseException; Object[] args = new Object[1]; args[0] = databaseException; log(SessionLog.INFO, SessionLog.TRANSACTION, "communication_failure_attempting_begintransaction_retry", args, null); // Attempt to reconnect connection. exceptionToThrow = retryTransaction(accessor, databaseException, 0, this); if (exceptionToThrow == null) { // Retry was a success. return; } handleException(exceptionToThrow); } else { handleException(databaseException); } } catch (RuntimeException exception) { handleException(exception); } }
} catch (DatabaseException databaseException) { if ((!getLogin().shouldUseExternalTransactionController()) && databaseException.isCommunicationFailure()) { DatabaseException exceptionToThrow = databaseException; log(SessionLog.INFO, "communication_failure_attempting_query_retry", (Object[])null, null);
if (databaseException.isCommunicationFailure()){ this.log(SessionLog.INFO, "communication_failure_attempting_query_retry", (Object[])null, null);
if (databaseException.isCommunicationFailure()) { Object[] args = new Object[1]; args[0] = databaseException;
final int count = getLogin().getQueryRetryAttemptCount(); if (databaseException.isCommunicationFailure() && retryCount < count) { Object[] args = new Object[1]; args[0] = databaseException;