You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2022/03/01 12:30:00 UTC

[jira] [Closed] (TINKERPOP-2707) Closing parent connection in python should close tx() connections

     [ https://issues.apache.org/jira/browse/TINKERPOP-2707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Mallette closed TINKERPOP-2707.
---------------------------------------
    Fix Version/s: 3.6.0
                   3.5.3
         Assignee: Stephen Mallette
       Resolution: Done

> Closing parent connection in python should close tx() connections
> -----------------------------------------------------------------
>
>                 Key: TINKERPOP-2707
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2707
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: python
>    Affects Versions: 3.5.2
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Blocker
>             Fix For: 3.6.0, 3.5.3
>
>
> If you do:
> {code}
> graph=Graph()
> connection = DriverRemoteConnection(endpoint,'g',
>                  transport_factory=lambda:AiohttpTransport(call_from_event_loop=True))
> g = graph.traversal().withRemote(connection)
> tx = g.tx()
> gtx = tx.begin()
> try:
>     id1 = gtx.addV('id1').next()
>     id2 = gtx.addV('id2').next()
> except Exception as e:
>     tx.rollback()
> else:
>     print(id1,id2)
>               
> connection.close()
> {code}
> The connection in {{tx}} won't be closed and it will be up to the server to timeout the connection in its normal fashion. While this isn't the expected way {{tx}} should be used, it is a bit of a hole someone could stumble in. Seems like, the close of the parent {{connection}} should also close any spawned child connections. It might be worth looking at Java to see how the implementation works there as well.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)