You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Florian Hockmann (Jira)" <ji...@apache.org> on 2022/06/07 07:37:00 UTC
[jira] [Commented] (TINKERPOP-2751) Transaction: tx.commit() hangs up in javascript client-lib
[ https://issues.apache.org/jira/browse/TINKERPOP-2751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17550852#comment-17550852 ]
Florian Hockmann commented on TINKERPOP-2751:
---------------------------------------------
You're using TinkerGraph here which doesn't support transactions. You need to use a graph provider that supports transactions like Neo4j-Gremlin as [shown in the reference docs|https://tinkerpop.apache.org/docs/current/reference/#_configuring].
I guess it's unfortunate that the driver just hangs there instead of throwing some exceptions that informs about the lacking support for transactions. [~spmallette] Any idea whether we could improve this behavior with reasonable effort?
> Transaction: tx.commit() hangs up in javascript client-lib
> ----------------------------------------------------------
>
> Key: TINKERPOP-2751
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2751
> Project: TinkerPop
> Issue Type: Bug
> Components: javascript, server
> Affects Versions: 3.6.0
> Reporter: Stefan Templin
> Priority: Minor
> Labels: Transaction
>
> Hi,
> I am trying to get transactions working for a while now, but no matter what i do, i can't get the transaction to commit.
> h3. My Setup:
> * Running gremlin-server 3.6.0 in Docker on localhost using the default-configuration.
> {code}
> version: '3.7'
> services:
> gremlin:
> image: tinkerpop/gremlin-server:3.6.0
> container_name: gremlin
> restart: always
> ports:
> - "8182:8182"
> {code}
> * Javascript-Gremlin-lib 3.6.0
> h3. Problem:
> Im executing the following code:
>
> {code:js}
> const dc = new DriverRemoteConnection('ws://localhost:8182/gremlin', { 'rejectUnauthorized': false});
> const g = traversal().withRemote(dc);
> const tx = g.tx();
> const gtx = tx.begin();
> try {
> await gtx.addV('person').iterate();
> await gtx.addV('software').iterate();
> await tx.commit();
> // stuck here
> console.log('here')
> } catch (err) {
> await tx.rollback();
> } finally {
> await dc.close();
> }{code}
> The code just will never get past 'await tx.commit()', no error, nothing. It just hangs up there. The code before that is properly executed and the Graph contains both vertices.
> Am I doing anything wrong there, or are transactions not working properly?
> Hope you can help me with that.
>
> Kind regards,
> Stefan
--
This message was sent by Atlassian Jira
(v8.20.7#820007)