mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Note that a Neo4j reactive transaction manager is not auto-configured
Closes gh-23629
This commit is contained in:
parent
bd27756efc
commit
27af908b99
@ -82,6 +82,7 @@ dependencies {
|
||||
implementation("org.springframework:spring-web")
|
||||
implementation("org.springframework:spring-webflux")
|
||||
implementation("org.springframework.data:spring-data-couchbase")
|
||||
implementation("org.springframework.data:spring-data-neo4j")
|
||||
implementation("org.springframework.data:spring-data-redis")
|
||||
implementation("org.springframework.data:spring-data-r2dbc")
|
||||
implementation("org.springframework.kafka:spring-kafka")
|
||||
|
@ -4791,6 +4791,17 @@ When Project Reactor is available on the classpath, the reactive style is also a
|
||||
|
||||
You can customize the locations to look for repositories and entities by using `@EnableNeo4jRepositories` and `@EntityScan` respectively on a `@Configuration`-bean.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
In an application using the reactive style, a `ReactiveTransactionManager` is not auto-configured.
|
||||
To enable transaction management, the following bean must be defined in your configuration:
|
||||
|
||||
[source,java,indent=0]
|
||||
----
|
||||
include::{code-examples}/neo4j/Neo4jReactiveTransactionManagerExample.java[tag=configuration]
|
||||
----
|
||||
====
|
||||
|
||||
|
||||
|
||||
[[boot-features-solr]]
|
||||
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.neo4j;
|
||||
|
||||
import org.neo4j.driver.Driver;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.neo4j.core.ReactiveDatabaseSelectionProvider;
|
||||
import org.springframework.data.neo4j.core.transaction.ReactiveNeo4jTransactionManager;
|
||||
import org.springframework.transaction.ReactiveTransactionManager;
|
||||
|
||||
/**
|
||||
* Example to show user-defined registration of a {@link ReactiveTransactionManager}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class Neo4jReactiveTransactionManagerExample {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
public ReactiveNeo4jTransactionManager reactiveTransactionManager(Driver driver,
|
||||
ReactiveDatabaseSelectionProvider databaseNameProvider) {
|
||||
return new ReactiveNeo4jTransactionManager(driver, databaseNameProvider);
|
||||
}
|
||||
// end::configuration[]
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user