Package org.axonframework.eventstore

Examples of org.axonframework.eventstore.EventStoreException


            dataOutputStream.writeLong(offset);
            FileSystemEventMessageWriter eventMessageWriter =
                    new FileSystemEventMessageWriter(dataOutputStream, eventSerializer);
            eventMessageWriter.writeEventMessage(snapshotEvent);
        } catch (IOException e) {
            throw new EventStoreException("Error writing a snapshot event due to an IO exception", e);
        } finally {
            IOUtils.closeQuietly(snapshotEventFile);
        }
    }
View Full Code Here


            if (result.next()) {
                return sqlSchema.createSerializedDomainEventData(result);
            }
            return null;
        } catch (SQLException e) {
            throw new EventStoreException("Exception while attempting to load last snapshot event of "
                                                  + aggregateType + "/" + identifier, e);
        } finally {
            closeQuietly(result);
            closeQuietly(connection);
        }
View Full Code Here

            Connection connection = connectionProvider.getConnection();
            return new ConnectionResourceManagingIterator<T>(
                    new FilteredBatchingIterator<T>(whereClause, parameters, batchSize, sqlSchema, connection),
                    connection);
        } catch (SQLException e) {
            throw new EventStoreException("Exception while attempting to read from the Event Store database", e);
        }
        // we don't want to close the connection here. The ConnectionResourceManagingIterator will close the connection
        // when it finishes iterating the results.
    }
View Full Code Here

                                                                       serializedPayload.getData(),
                                                                       serializedMetaData.getData(),
                                                                       aggregateType);
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            throw new EventStoreException("Exception while attempting to persist a snapshot", e);
        } finally {
            closeQuietly(preparedStatement);
            closeQuietly(connection);
        }
    }
View Full Code Here

                                                                     serializedMetaData.getData(),
                                                                     aggregateType
            );
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            throw new EventStoreException("Exception occurred while attempting to persist an event", e);
        } finally {
            closeQuietly(preparedStatement);
            closeQuietly(connection);
        }
    }
View Full Code Here

                executeUpdate(sqlSchema.sql_pruneSnapshots(connection,
                                                           type,
                                                           mostRecentSnapshotEvent.getAggregateIdentifier(),
                                                           sequenceOfFirstSnapshotToPrune), "prune snapshots");
            } catch (SQLException e) {
                throw new EventStoreException("An exception occurred while attempting to prune snapshots", e);
            } finally {
                closeQuietly(connection);
            }
        }
    }
View Full Code Here

                result.add(resultSet.getLong(1));
            }
            resultSet.close();
            return result.iterator();
        } catch (SQLException e) {
            throw new EventStoreException("Exception ", e);
        } finally {
            closeQuietly(resultSet);
            closeQuietly(statement);
            closeQuietly(connection);
        }
View Full Code Here

                    new PreparedStatementIterator<T>(statement, sqlSchema),
                    connection);
        } catch (SQLException e) {
            closeQuietly(connection);
            closeQuietly(statement);
            throw new EventStoreException("Exception while attempting to read from an Aggregate Stream", e);
        }
    }
View Full Code Here

    private int executeUpdate(PreparedStatement preparedStatement, String description) {
        try {
            return preparedStatement.executeUpdate();
        } catch (SQLException e) {
            throw new EventStoreException("Exception occurred while attempting to " + description, e);
        } finally {
            closeQuietly(preparedStatement);
        }
    }
View Full Code Here

                        batchWhereClause,
                        params.toArray());
                sql.setMaxRows(batchSize);
                return new PreparedStatementIterator<T>(sql, sqlSchema);
            } catch (SQLException e) {
                throw new EventStoreException("Exception occurred while attempting to execute prepared statement", e);
            }
        }
View Full Code Here

TOP

Related Classes of org.axonframework.eventstore.EventStoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.