-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed as not planned
Closed as not planned
Copy link
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Hi,
We moved from Spring Boot 2.7.3 to 3.0.1 and we also using Spring Data. After that, we noticed the Neo4jTransactionManager was missing, so any configuration like transaction timeout, was not working anymore
We made the follow code as workaround to solve the problem:
import org.neo4j.driver.Driver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.core.DatabaseSelectionProvider;
import org.springframework.data.neo4j.core.transaction.Neo4jBookmarkManager;
import org.springframework.data.neo4j.core.transaction.Neo4jTransactionManager;
import org.springframework.data.neo4j.repository.config.Neo4jRepositoryConfigurationExtension;
import java.util.Objects;
@Configuration
@SuppressWarnings("unused")
public class Neo4jTransactionConfiguration {
@ConditionalOnMissingBean(name = Neo4jRepositoryConfigurationExtension.DEFAULT_TRANSACTION_MANAGER_BEAN_NAME)
@Bean(name = "transactionManager")
public Neo4jTransactionManager neo4jTransactionManager(@Autowired Driver driver,
@Autowired DatabaseSelectionProvider databaseSelectionProvider,
@Autowired(required = false) Neo4jBookmarkManager neo4jBookmarkManager) {
return new Neo4jTransactionManager(driver, databaseSelectionProvider,
Objects.requireNonNullElseGet(neo4jBookmarkManager, Neo4jBookmarkManager::create));
}
}I opened this Issue to share the problem and help people with this workaround until this got fixed
Metadata
Metadata
Assignees
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid