Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Mandatory transactions #9

Open
john8329 opened this issue Jan 15, 2019 · 2 comments
Open

Mandatory transactions #9

john8329 opened this issue Jan 15, 2019 · 2 comments

Comments

@john8329
Copy link

Hi, and thanks for this code, I'm trying to modify it and improve the implementation a bit for my use. One thing I noticed is that the Gateway always checks for open transactions while executing commands. This forces the developer to always open a Tx object when working with the sql.DB. It seems weird to me, is there a reason why this design choice was made? Shouldn't it be better to support self-contained statements that execute without transactions?

Thanks

@freeekanayaka
Copy link
Contributor

Hi, the reason is basically that he Raft-based replication that this code was meant to support requires everything to happen in a transaction, and to only have only at most one write transaction active at time.

What is your use case?

At the moment this Go package is pretty much deprecated, since we've switched to a totally different implementation, because grpc turned out to be kind of slow for this kind of low-level APIs.

Feel free to to whatever modification you need, and I can probably merge it.

@john8329
Copy link
Author

The use case is to have application modules that refer to a central broker for database connections. The modules are loaded as separate processes to avoid crashing the server, so they communicate via gRPC. Also I'm going to use it to implement an odbc-to-sql bridge for a platform that offers no better alternative.

Just for curiosity, what alternative did you choose? I think I'll stick with grpc for now, but just to get some insights.

Thanks

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

No branches or pull requests

2 participants