Skip to content

Commit 27af908

Browse files
committed
Note that a Neo4j reactive transaction manager is not auto-configured
Closes gh-23629
1 parent bd27756 commit 27af908

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ dependencies {
8282
implementation("org.springframework:spring-web")
8383
implementation("org.springframework:spring-webflux")
8484
implementation("org.springframework.data:spring-data-couchbase")
85+
implementation("org.springframework.data:spring-data-neo4j")
8586
implementation("org.springframework.data:spring-data-redis")
8687
implementation("org.springframework.data:spring-data-r2dbc")
8788
implementation("org.springframework.kafka:spring-kafka")

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4791,6 +4791,17 @@ When Project Reactor is available on the classpath, the reactive style is also a
47914791

47924792
You can customize the locations to look for repositories and entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a `@Configuration`-bean.
47934793

4794+
[NOTE]
4795+
====
4796+
In an application using the reactive style, a `ReactiveTransactionManager` is not auto-configured.
4797+
To enable transaction management, the following bean must be defined in your configuration:
4798+
4799+
[source,java,indent=0]
4800+
----
4801+
include::{code-examples}/neo4j/Neo4jReactiveTransactionManagerExample.java[tag=configuration]
4802+
----
4803+
====
4804+
47944805

47954806

47964807
[[boot-features-solr]]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2012-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.docs.neo4j;
18+
19+
import org.neo4j.driver.Driver;
20+
21+
import org.springframework.context.annotation.Bean;
22+
import org.springframework.context.annotation.Configuration;
23+
import org.springframework.data.neo4j.core.ReactiveDatabaseSelectionProvider;
24+
import org.springframework.data.neo4j.core.transaction.ReactiveNeo4jTransactionManager;
25+
import org.springframework.transaction.ReactiveTransactionManager;
26+
27+
/**
28+
* Example to show user-defined registration of a {@link ReactiveTransactionManager}.
29+
*
30+
* @author Stephane Nicoll
31+
*/
32+
@Configuration(proxyBeanMethods = false)
33+
public class Neo4jReactiveTransactionManagerExample {
34+
35+
// tag::configuration[]
36+
@Bean
37+
public ReactiveNeo4jTransactionManager reactiveTransactionManager(Driver driver,
38+
ReactiveDatabaseSelectionProvider databaseNameProvider) {
39+
return new ReactiveNeo4jTransactionManager(driver, databaseNameProvider);
40+
}
41+
// end::configuration[]
42+
43+
}

0 commit comments

Comments
 (0)