Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multitransact support for remote connections #14

Open
hosford42 opened this issue Jul 10, 2024 · 5 comments
Open

Add multitransact support for remote connections #14

hosford42 opened this issue Jul 10, 2024 · 5 comments

Comments

@hosford42
Copy link
Contributor

What needs to happen for this to be added? I'd like to help.

raise RuntimeError('Multi-transaction not yet supported for remote')

@hosford42
Copy link
Contributor Author

hosford42 commented Jul 10, 2024

Looking at the cozo source, it appears to be supported on the server side:

https://github.com/cozodb/cozo/blob/6ab063c627a57242ff42d563dfa1ce41264bcc72/cozo-bin/src/server.rs#L255C1-L256C72

        .route("/transact", post(start_transact))
        .route("/transact/:id", post(transact_query).put(finish_query))

I think it just needs a class with the same interface as MultiTransact to wrap these API calls so they are made at the right times. Is there anything I'm overlooking?

@hosford42
Copy link
Contributor Author

I have code implemented to handle this now, but I'm getting a 400 Client Error: Bad Request for the /transact endpoint. It's clearly there in the rust code. Is it possible this was somehow excluded from the build I'm running? I'm running the precompiled cozo binary for windows x64, cozo-0.7.6-x86_64-pc-windows-msvc.exe, from the latest release.

@hosford42
Copy link
Contributor Author

I sorted out the bad request issue. User error, no surprise there. Now trying to identify why the actual query is hanging.

@hosford42
Copy link
Contributor Author

Submitted a pull request: #16

Let me know if you'd like me to make other changes in order to accept.

@hosford42
Copy link
Contributor Author

The query hanging issue appears to be related to improper termination of the client, and seems to only affect the mem engine. I think it needs to be addressed on the server side. A client error shouldn't impact future connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant