Created
July 28, 2015 17:30
-
-
Save maxdemarzi/bf4547ef108914cd82f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 0; | |
Transaction tx = db.beginTx(); | |
try { | |
for ( Relationship relationship : GlobalGraphOperations.at(db).getAllRelationships()) { | |
// Do some work on relationship property | |
i++; | |
// Commit every x transactions | |
if (i % 10000 == 0) { | |
tx.success(); | |
tx.close(); | |
tx = db.beginTx(); | |
} | |
} | |
tx.success(); | |
} finally { | |
tx.close(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment