Announcement Announcement Module
Collapse
No announcement yet.
SDN: template.beginTx() vs. TransactionTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDN: template.beginTx() vs. TransactionTemplate

    Hello everyone

    What are the pros and cons of using either pure neo4j transactions with template.beginTx() or starting transaction with spring's TransactionTemplate when using Spring Data Neo4j.

    PHP Code:
    Transaction tx template.beginTx();
    try {
      
    doSomething();
      
    tx.success();
    }
    finally {
      
    tx.finish();

    vs.
    PHP Code:
    TransactionTemplate t = new TransactionTemplate(txManager);
    t.execute(new TransactionCallback<Void>() {
      @
    Override
      
    public Void doInTransaction(TransactionStatus status) {
        
    doSomething();
        return 
    null;
      }
    }); 

    Best regards,
    James
Working...
X