Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.Transaction.failure()


            // read transaction
            IteratorUtil.count(template.getGraphDatabaseService().getRelationshipTypes());
            tx.success();
        } catch (Exception e) {
            if (tx != null) {
                tx.failure();
            }
            throw new BeanCreationException("transactionManager not correctly configured, please refer to the manual, setup section",e);
        } finally {
            try {
                if (tx != null) tx.close();
View Full Code Here


        Neo4jTemplate template = new Neo4jTemplate(factoryBean.getObject());
        Transaction tx = db.beginTx();
        Person person = template.save(new Person());
        person.setName("Bar");
        template.save(person);
        tx.failure();
        tx.close();
    }
}
View Full Code Here

        T result = null;
        try {
            result = callback.doInTransaction(database); //can throw a business exception
            tx.success();
        } catch (RuntimeException e) {
            tx.failure();
            throw e;
        } catch (Exception e) {
            tx.failure();
            throw new RuntimeException(e);
        } finally {
View Full Code Here

            tx.success();
        } catch (RuntimeException e) {
            tx.failure();
            throw e;
        } catch (Exception e) {
            tx.failure();
            throw new RuntimeException(e);
        } finally {
            tx.close(); //can throw a DB exception
        }
        return result;
View Full Code Here

            node.setProperty( "foo", "bar" );
            transaction.success();
        }
        catch ( Exception e )
        {
            transaction.failure();
        }
        finally
        {
            transaction.finish();
        }
View Full Code Here

            return 0;
        }
        catch (Exception e)
        {
            System.err.println(e.toString());
            tx.failure();
            return 1;
        }       
    }
  
   
View Full Code Here

            personClass.getDirectProperties().add( nameProperty );
            tx.success();
        }
        catch ( Exception e )
        {
            tx.failure();
        }
        finally
        {
            tx.finish();
        }
View Full Code Here

        catch ( Exception e )
        { // ok
        }
        try
        {
            tx.failure();
            tx.finish();
            // fail( "Transaction should be marked rollback" );
        }
        catch ( Exception e )
        { // good
View Full Code Here

                    e.printStackTrace();
                    throw e;
                }
                finally
                {
                    tx.failure();
                }
            }
        };
        thread.start();
        long endTime = System.currentTimeMillis() + 5000;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.