Skip to content

Transaction stuck after first step execution #39

@timemanx

Description

@timemanx

Hi,

I'm using the transaction API but it seems the transaction always gets stuck after executing the first step.
I'm using EdgeDB 5.6 on EdgeDB Cloud and Java client library version 0.3.0.

Here is a simple example using Kotlin.

package com.test.edgedbclient

import com.edgedb.driver.EdgeDBClient
import com.edgedb.driver.EdgeDBConnection
import kotlinx.coroutines.future.await

suspend fun main() {
    val client = EdgeDBClient(EdgeDBConnection.parse(null, null, true))
    val output = client.transaction { tx ->
        tx.query(String::class.java, "SELECT 'Hello, World 1!'")
            .thenCompose {
                println("Output0: $it")
                tx.query(String::class.java, "SELECT 'Hello, World 2!'")
            }
            .thenCompose {
                println("Output1: $it")
                tx.query(String::class.java, "SELECT 'Hello, World 3!'")
            }
    }.await()

    println("--- Completed ---")
    println("Final output: $output")
    client.close()
}

The output is Output0: [Hello, World 1!] from the first step and then it's stuck.

I believe this is happening due to the semaphore in TransactionImpl being acquired
https://github.com/edgedb/edgedb-java/blob/3ddbee1455ad0216d96346ceb71e34ec158bc88f/src/driver/src/main/java/com/edgedb/driver/internal/TransactionImpl.java#L98-L114
but never being released in the executeTransactionStep method after completion of the step.
https://github.com/edgedb/edgedb-java/blob/3ddbee1455ad0216d96346ceb71e34ec158bc88f/src/driver/src/main/java/com/edgedb/driver/internal/TransactionImpl.java#L71-L96

This issue could be the same as #21.

Please let me know if any other details are required.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions