public class PostgresSagaSqlSchema extends GenericSagaSqlSchema
sagaSchema
Constructor and Description |
---|
PostgresSagaSqlSchema()
Initialize a PostgresSagaSqlSchema using the default schema configuration.
|
PostgresSagaSqlSchema(SagaSchema sagaSchema)
Initialize a PostgresSagaSqlSchema using the given
sagaSchema . |
Modifier and Type | Method and Description |
---|---|
void |
setExclusiveLoad(boolean exclusiveLoad)
Sets whether loading of Sagas should occur exclusively by a single node, by requiring a row lock from the
database.
|
PreparedStatement |
sql_createTableAssocValueEntry(Connection conn)
Creates a PreparedStatement that creates the table for storing Association Values for Sagas.
|
PreparedStatement |
sql_createTableSagaEntry(Connection conn)
Creates a PreparedStatement that creates the table for storing Sagas.
|
PreparedStatement |
sql_loadSaga(Connection connection,
String sagaId)
Creates a PreparedStatement that loads a single Saga, with given
sagaId . |
readAssociationValues, readSerializedSaga, readToken, sagaSchema, sql_deleteAssociationEntries, sql_deleteSagaEntry, sql_findAssociations, sql_findAssocSagaIdentifiers, sql_removeAssocValue, sql_storeAssocValue, sql_storeSaga, sql_updateSaga
public PostgresSagaSqlSchema()
public PostgresSagaSqlSchema(SagaSchema sagaSchema)
sagaSchema
.sagaSchema
- the saga schema configurationpublic PreparedStatement sql_createTableAssocValueEntry(Connection conn) throws SQLException
SagaSqlSchema
sql_createTableAssocValueEntry
in interface SagaSqlSchema
sql_createTableAssocValueEntry
in class GenericSagaSqlSchema
conn
- The connection to create the PreparedStatement forSQLException
- when an error occurs creating the PreparedStatementpublic PreparedStatement sql_createTableSagaEntry(Connection conn) throws SQLException
SagaSqlSchema
sql_createTableSagaEntry
in interface SagaSqlSchema
sql_createTableSagaEntry
in class GenericSagaSqlSchema
conn
- The connection to create the PreparedStatement forSQLException
- when an error occurs creating the PreparedStatementpublic PreparedStatement sql_loadSaga(Connection connection, String sagaId) throws SQLException
SagaSqlSchema
sagaId
.sql_loadSaga
in interface SagaSqlSchema
sql_loadSaga
in class GenericSagaSqlSchema
connection
- The connection to create the PreparedStatement forsagaId
- The identifier of the Saga to returnSagaSqlSchema.readSerializedSaga(java.sql.ResultSet)
,
when executedSQLException
- when an error occurs creating the PreparedStatementpublic void setExclusiveLoad(boolean exclusiveLoad)
If true
, only one instance of the application may load a saga at a time. This may be used to serialize
event handling in sagas in multi-node configurations where no
StreamingEventProcessor
is used. The given processor type caveat is
explained through the fact that a StreamingEventProcessor
requires claimed segments to be able to perform
any event handling work. Furthermore, this segments originate from a shared resources in a distributed
environment.
As such, a Saga cannot be accessed concurrently through the StreamingEventProcessor
. And hence, setting
exclusiveLoad
to true
would not change the underlying behavior at all.
Copyright © 2010–2024. All rights reserved.