@Test void testLoadSaga_NotFound() { assertNull(testSubject.loadSaga(StubSaga.class, "123456")); }
@Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { PreparedStatement statement = null; ResultSet resultSet = null; Connection conn = null; try { conn = connectionProvider.getConnection(); statement = sqlSchema.sql_loadSaga(conn, sagaIdentifier); resultSet = statement.executeQuery(); SerializedObject<?> serializedSaga = null; if (resultSet.next()) { serializedSaga = sqlSchema.readSerializedSaga(resultSet); } if (serializedSaga == null) { return null; } S loadedSaga = serializer.deserialize(serializedSaga); if (logger.isDebugEnabled()) { logger.debug("Loaded saga id [{}] of type [{}]", sagaIdentifier, loadedSaga.getClass().getName()); } return new EntryImpl<>(loadAssociations(conn, sagaTypeName(sagaType), sagaIdentifier), loadedSaga); } catch (SQLException e) { throw new SagaStorageException("Exception while loading a Saga", e); } finally { closeQuietly(statement); closeQuietly(resultSet); closeQuietly(conn); } }
JdbcSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { PreparedStatement statement = null; ResultSet resultSet = null; Connection conn = null; try { conn = connectionProvider.getConnection(); statement = sqlSchema.sql_loadSaga(conn, sagaIdentifier); resultSet = statement.executeQuery(); SerializedObject<?> serializedSaga = null; if (resultSet.next()) { serializedSaga = sqlSchema.readSerializedSaga(resultSet); } if (serializedSaga == null) { return null; } S loadedSaga = serializer.deserialize(serializedSaga); if (logger.isDebugEnabled()) { logger.debug("Loaded saga id [{}] of type [{}]", sagaIdentifier, loadedSaga.getClass().getName()); } return new EntryImpl<>(loadAssociations(conn, sagaTypeName(sagaType), sagaIdentifier), loadedSaga); } catch (SQLException e) { throw new SagaStorageException("Exception while loading a Saga", e); } finally { closeQuietly(statement); closeQuietly(resultSet); closeQuietly(conn); } } }
JdbcSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { PreparedStatement statement = null; ResultSet resultSet = null; Connection conn = null; try { conn = connectionProvider.getConnection(); statement = sqlSchema.sql_loadSaga(conn, sagaIdentifier); resultSet = statement.executeQuery(); SerializedObject<?> serializedSaga = null; if (resultSet.next()) { serializedSaga = sqlSchema.readSerializedSaga(resultSet); } if (serializedSaga == null) { return null; } S loadedSaga = serializer.deserialize(serializedSaga); if (logger.isDebugEnabled()) { logger.debug("Loaded saga id [{}] of type [{}]", sagaIdentifier, loadedSaga.getClass().getName()); } return new EntryImpl<>(loadAssociations(conn, sagaTypeName(sagaType), sagaIdentifier), loadedSaga); } catch (SQLException e) { throw new SagaStorageException("Exception while loading a Saga", e); } finally { closeQuietly(statement); closeQuietly(resultSet); closeQuietly(conn); } } protected  JdbcSagaStore(Builder builder); }
JdbcSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { PreparedStatement statement = null; ResultSet resultSet = null; Connection conn = null; try { conn = connectionProvider.getConnection(); statement = sqlSchema.sql_loadSaga(conn, sagaIdentifier); resultSet = statement.executeQuery(); SerializedObject<?> serializedSaga = null; if (resultSet.next()) { serializedSaga = sqlSchema.readSerializedSaga(resultSet); } if (serializedSaga == null) { return null; } S loadedSaga = serializer.deserialize(serializedSaga); if (logger.isDebugEnabled()) { logger.debug("Loaded saga id [{}] of type [{}]", sagaIdentifier, loadedSaga.getClass().getName()); } return new EntryImpl<>(loadAssociations(conn, sagaTypeName(sagaType), sagaIdentifier), loadedSaga); } catch (SQLException e) { throw new SagaStorageException("Exception while loading a Saga", e); } finally { closeQuietly(statement); closeQuietly(resultSet); closeQuietly(conn); } } protected  JdbcSagaStore(Builder builder); static Builder builder(); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue); @Override void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues); @Override void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues); @Override void insertSaga(Class<?> sagaType, String sagaIdentifier, Object saga,
                           Set<AssociationValue> associationValues); void setSerializer(Serializer serializer); void createSchema(); }
JdbcSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { PreparedStatement statement = null; ResultSet resultSet = null; Connection conn = null; try { conn = connectionProvider.getConnection(); statement = sqlSchema.sql_loadSaga(conn, sagaIdentifier); resultSet = statement.executeQuery(); SerializedObject<?> serializedSaga = null; if (resultSet.next()) { serializedSaga = sqlSchema.readSerializedSaga(resultSet); } if (serializedSaga == null) { return null; } S loadedSaga = serializer.deserialize(serializedSaga); if (logger.isDebugEnabled()) { logger.debug("Loaded saga id [{}] of type [{}]", sagaIdentifier, loadedSaga.getClass().getName()); } return new EntryImpl<>(loadAssociations(conn, sagaTypeName(sagaType), sagaIdentifier), loadedSaga); } catch (SQLException e) { throw new SagaStorageException("Exception while loading a Saga", e); } finally { closeQuietly(statement); closeQuietly(resultSet); closeQuietly(conn); } } protected  JdbcSagaStore(Builder builder); static Builder builder(); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue); @Override void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues); @Override void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues); @Override void insertSaga(Class<?> sagaType, String sagaIdentifier, Object saga,
                           Set<AssociationValue> associationValues); void setSerializer(Serializer serializer); void createSchema();  }