Description
As in topic https://groups.google.com/forum/#!topic/gremlin-users/cHl4FB-H7Nc we have discussed,TinkerPop currently support:
- Script sessionLess which is auto transaction;
- ByteCode sessionLess which is also auto transaction;
- Script session which user could control transaction through g.tx().open / rollback / commit;
As we knows that ByteCode based requests are themselves code written in the native language and could be checked to validate the Gremlin during the development process。 => so many user prefer to use ByteCode over Script。
But as we known,auto transaction need to persistence data changes per request which needs high cost and in some scenarios user even unbearable。=> so in some performance sensitive situation user prefer to use sessionBased interaction over sessionLess。
Here,we face the real trouble: if user need both high performance and good write experience,we sank into despair because we do not support byteCode session,here is another user‘s sample:https://stackoverflow.com/questions/55454068/tinkerpop-gremlin-transaction-processor-with-bytecode。
We must solve this problem even it is in less use because we all want to provide sufficiently good service to our user,but better transaction support in TP4 is still far away。 Here is my simple and meaningful solution:
We can provide a function which change byteCode into Parameterized Scripts (not a simple Script which we already have, Its performance is 10X lower) 。 Yes,we just need to add a new translate function in "org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator.java"。
The code is ready and through test, if anyone agree that this it's meaningful, i will submit PR later, thanks for your patience。
The user code would like: