Note that a Neo4j reactive transaction manager is not auto-configured
Closes gh-23629pull/23694/head
parent
bd27756efc
commit
27af908b99
@ -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