From 52b3064b169ba3d75c1d04a7536da48982f79307 Mon Sep 17 00:00:00 2001 From: David Montag Date: Fri, 8 Apr 2011 16:12:27 -0700 Subject: [PATCH] Edited transactions chapter of reference --- .../programming-model/transactions.xml | 138 ++++++++++-------- 1 file changed, 79 insertions(+), 59 deletions(-) diff --git a/src/docbkx/reference/programming-model/transactions.xml b/src/docbkx/reference/programming-model/transactions.xml index a6434dbb1..6ced9e2c7 100644 --- a/src/docbkx/reference/programming-model/transactions.xml +++ b/src/docbkx/reference/programming-model/transactions.xml @@ -3,91 +3,111 @@
Transactions in Spring Data Graph - Neo4j is a transactional datastore which only allows modifications within transaction boundaries and fullfills - the ACID properties. Reading from the store is also possible outside of transactions. + Neo4j is a transactional database, only allowing modifications to be performed within transaction + boundaries. Reading data does however not require transactions. - - Spring Data Graph integrates with transaction managers configured using Spring. The simplest scenario of - just running the graph database uses a SpringTransactionManager provided by the Neo4j kernel to be used - with Spring's JtaTransactionManager. - - Note: The explicit XML configuration given below is encoded in the Neo4jConfiguration - configuration bean that uses Spring's @Configuration functioanlity. This simplifies the configuration. - An example is shown further below. + + Spring Data Graph integrates with transaction managers configured using Spring. The simplest + scenario of just running the graph database uses a SpringTransactionManager provided by the + Neo4j kernel to be used with Spring's JtaTransactionManager. That is, configuring Spring to + use Neo4j's transaction manager. - + + The explicit XML configuration given below is encoded in the Neo4jConfiguration + configuration bean that uses Spring's @Configuration feature. This greatly + simplifies the configuration of Spring Data Graph. + + + + + Simple transaction manager configuration + - - - - - - - - - - + + + + + + + + + + ]]> + - For scenarios running multiple transactional resources there are two options. - First of all you can have Neo4j participate in the externally set up transaction manager using the new - SpringProvider by enabling the configuration parameter for your graph database. Either via the spring config - or the configuration file (neo4j.properties). + For scenarios with multiple transactional resources there are two options. The first option + is to have Neo4j participate in the externally configured transaction manager by using the + Spring support in Neo4j by enabling the configuration parameter for your graph database. + Neo4j will then use Spring's transaction manager instead of its own. - + Neo4j Spring integration + - - - + + + - - - - - - + + + + + + - ]]> +]]> + - You can configure a stock XA transaction manager to be used with Neo4j and the other resources (e.g. Atomikos, - JOTM, App-Server-TM). For a bit less secure but fast 1 phase commit best effort, use the implementation coming - with Spring Data Graph (ChainedTransactionManager). It takes a list of transaction-managers as - constructor params and will handle them in order for transaction start and commit (or rollback) in the reverse - order. + One can also configure a stock XA transaction manager (e.g. Atomikos, JOTM, App-Server-TM) to be + used with Neo4j and the other resources. For a bit less secure but fast 1 phase commit best effort, + use ChainedTransactionManager, which comes bundled with Spring Data Graph. It takes a + list of transaction managers as constructor params and will handle them in order for transaction + start and commit (or rollback) in the reverse order. - + ChainedTransactionManager example + + + + + + + + + + + + + + + + class="org.springframework.data.graph.neo4j.transaction.ChainedTransactionManager"> - - - - - - - - - - - - - - - + + + + ]]> + +