[wildfly-dev] (transaction enlistment for ACID but none for BASE...) update on WildFly NoSQL prototype integration...

Scott Marlow smarlow at redhat.com
Mon Jul 18 12:20:15 EDT 2016


Thanks for the feedback.

On 07/18/2016 09:24 AM, Emmanuel Bernard wrote:
> I'm lost.
>
> What is the expected code a developer will write ?
>
> If that' something along the lines of:
>
> jta.beginTx() // declaratively or imperatively
> neo4j.beginTx()
> ...
> neo4j.commit()
> jta.commit() //declaratively or imperatively

They are not limited to writing the above code.  In addition, the 
developer can also avoid calling neo4j.beginTx()/neo4j.commit(). 
Something like:

jta.beginTx() // declaratively or imperatively
session = driver.session() // internally does session.beginTransaction()
...
jta.commit() //declaratively or imperatively

The calls to neo4j.beginTx()/commit() are ignored.

The choice of ignoring those calls, is made against the alternative of 
throwing an exception.  The reason for ignoring the neo4j transactional 
calls, is to be more compatible with existing ne04j code that may be 
using the neo4j transactional code, with the goal that the JTA 
transaction controls the underlying ne04j transaction.  Neo4j 
transactional code also runs the statements against the neo4j 
transaction class, instead of the neo4j session class.

>
> then I find it very user unfriendly to force the code to call both Tx
> APIs. It should be one or the other.

Do you really want to rewrite your neo4j code to avoid the neo4j tx APIs 
when enlisted into a JTA transaction?  Or should the neo4j tx API calls 
be ignored when enlisted into a JTA transaction (as we are doing now)?

If we throw exceptions from Transaction.run(), developers may have to 
rewrite more code for use with JTA.

If this is still confusing, we can have a call to discuss. :)

Scott


More information about the wildfly-dev mailing list