use of javax.transaction.Transaction in project neo4j-mobile-android by neo4j-contrib.
the class LockReleaser method hasRelationshipModifications.
boolean hasRelationshipModifications(NodeImpl node) {
Transaction tx = getTransaction();
if (tx == null) {
return false;
}
PrimitiveElement primitiveElement = cowMap.get(tx);
if (primitiveElement != null) {
ArrayMap<Long, CowNodeElement> cowElements = primitiveElement.nodes;
CowNodeElement element = cowElements.get(node.getId());
if (element != null && (element.relationshipAddMap != null || element.relationshipRemoveMap != null)) {
return true;
}
}
return false;
}
use of javax.transaction.Transaction in project neo4j-mobile-android by neo4j-contrib.
the class LockReleaser method commitCows.
public void commitCows() {
Transaction tx = getTransaction();
propertyIndexManager.commit(tx);
releaseCows(tx, Status.STATUS_COMMITTED);
}
use of javax.transaction.Transaction in project neo4j-mobile-android by neo4j-contrib.
the class LockReleaser method getAndSetupPrimitiveElement.
private PrimitiveElement getAndSetupPrimitiveElement() {
Transaction tx = getTransaction();
if (tx == null) {
throw new NotInTransactionException();
}
PrimitiveElement primitiveElement = cowMap.get(tx);
if (primitiveElement == null) {
primitiveElement = new PrimitiveElement();
cowMap.put(tx, primitiveElement);
}
return primitiveElement;
}
use of javax.transaction.Transaction in project neo4j-mobile-android by neo4j-contrib.
the class LockReleaser method dumpLocks.
// non thread safe but let exception be thrown instead of risking deadlock
public void dumpLocks() {
System.out.print("Locks held: ");
java.util.Iterator<?> itr = lockMap.keySet().iterator();
if (!itr.hasNext()) {
System.out.println("NONE");
} else {
System.out.println();
}
while (itr.hasNext()) {
Transaction transaction = (Transaction) itr.next();
System.out.println("" + transaction + "->" + lockMap.get(transaction).size());
}
}
use of javax.transaction.Transaction in project neo4j-mobile-android by neo4j-contrib.
the class LockReleaser method commit.
public void commit() {
Transaction tx = getTransaction();
// propertyIndex
releaseLocks(tx);
}
Aggregations