Skip to content

Commit d5f18af

Browse files
Malte Jörgensaburmeis
authored andcommitted
#80 made QueryTransactionBridge an optional @bean
1 parent 6d050ff commit d5f18af

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/com/arangodb/springframework/repository/ArangoRepositoryFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public void setArangoOperations(final ArangoOperations arangoOperations) {
5252
this.arangoOperations = arangoOperations;
5353
}
5454

55-
@Autowired
56-
public void setArangoOperations(final QueryTransactionBridge transactionBridge) {
55+
@Autowired(required = false)
56+
public void setQueryTransactionBridge(final QueryTransactionBridge transactionBridge) {
5757
this.transactionBridge = transactionBridge;
5858
}
5959

src/main/java/com/arangodb/springframework/repository/query/AbstractArangoQuery.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import com.arangodb.velocypack.VPackSlice;
3939

4040
/**
41-
*
41+
*
4242
* @author Audrius Malele
4343
* @author Mark McCormick
4444
* @author Mark Vollmary
@@ -58,7 +58,6 @@ public AbstractArangoQuery(final ArangoQueryMethod method, final ArangoOperation
5858
final QueryTransactionBridge transactionBridge) {
5959
Assert.notNull(method, "ArangoQueryMethod must not be null!");
6060
Assert.notNull(operations, "ArangoOperations must not be null!");
61-
Assert.notNull(transactionBridge, "QueryTransactionBridge must not be null!");
6261
this.method = method;
6362
this.operations = operations;
6463
mappingContext = (ArangoMappingContext) operations.getConverter().getMappingContext();
@@ -81,7 +80,7 @@ public Object execute(final Object[] parameters) {
8180
}
8281

8382
final Pair<String, ? extends Collection<String>> queryAndCollection = createQuery(accessor, bindVars, options);
84-
if (options.getStreamTransactionId() == null) {
83+
if (options.getStreamTransactionId() == null && transactionBridge != null) {
8584
options.streamTransactionId(transactionBridge.beginCurrentTransaction(queryAndCollection.getSecond()));
8685
}
8786

0 commit comments

Comments
 (0)