use of org.neo4j.ogm.transaction.Transaction in project neo4j-ogm by neo4j.
the class BasicDriverTest method shouldNotFindExplicitlyRolledBackEntity.
@Test
public void shouldNotFindExplicitlyRolledBackEntity() {
Transaction tx = session.beginTransaction();
session.save(new User());
tx.rollback();
session.clear();
assertThat(session.loadAll(User.class)).isEmpty();
}
use of org.neo4j.ogm.transaction.Transaction in project neo4j-ogm by neo4j.
the class BasicDriverTest method doExtendedRollbackRollbackCommit.
private void doExtendedRollbackRollbackCommit() throws TransactionException {
try (Transaction tx = session.beginTransaction()) {
// rollback_deferred
m3();
// rollback_deferred
m3();
// cannot commit outer transaction
tx.commit();
}
}
use of org.neo4j.ogm.transaction.Transaction in project neo4j-ogm by neo4j.
the class BasicDriverTest method doExtendedRollbackCommitRollback.
private void doExtendedRollbackCommitRollback() {
try (Transaction tx = session.beginTransaction()) {
// rollback_deferred
m3();
// commit_deferred
m2();
tx.rollback();
}
}
use of org.neo4j.ogm.transaction.Transaction in project neo4j-ogm by neo4j.
the class BasicDriverTest method doExtendedCommitCommitCommit.
private void doExtendedCommitCommitCommit() {
try (Transaction tx = session.beginTransaction()) {
// commit_deferred
m2();
// commit_deferred
m2();
// should be able to commit outer transaction
tx.commit();
}
}
use of org.neo4j.ogm.transaction.Transaction in project neo4j-ogm by neo4j.
the class BaseAutoIndexManagerTestClass method executeCreate.
void executeCreate(String... statements) {
Session session = sessionFactory.openSession();
try (Transaction transaction = session.beginTransaction()) {
for (String statement : statements) {
logger.info("Execute CREATE " + statement);
session.query("CREATE " + statement, emptyMap());
}
transaction.commit();
}
}
Aggregations