-
Notifications
You must be signed in to change notification settings - Fork 17
Transactions implemented strangely #13
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
Comments
That would require to save state on the server what I tried to get rid of actually. Since we don't have a way to keep connections open, I'm not even sure if we could do this as we have no way of keeping the same connection over multiple messages. |
You would need to pool connections (like a JDBC connection pool does). You would not need to maintain the entire state of the transaction on the server, but what you're doing now is forcing the client to maintain that state, which could lead to OOM. |
So... in more detail... if a user starts a transaction you need to get a connection from the pool and put it in transaction mode, then as more commands arrive for that connection you apply them against that same connection (and nothing else can use that connection). |
Okay, I guess this is something we should be able to do as soon as we have a |
There's nothing particularly complex about an asynchronous pool, here's an example: https://github.com/eclipse/vert.x/blob/master/vertx-core/src/main/java/org/vertx/java/core/http/impl/PriorityHttpConnectionPool.java |
Finally, the new way to handle transactions made it into 0.3.0 release. Thanks! |
The way that transactions are implemented using a "transaction" message does not look right to me.
Requiring the transaction message to contain all the operations of the transaction does not scale (transactions can be very big!) and does not seem necessary.
A better way to implement this would be to have a "transaction_start" message which the user sends to start a transaction, then the user sends operations (insert, delete etc) as normal, and then a "transaction_commit" or "transaction_rollback" message to end the transaction.
The text was updated successfully, but these errors were encountered: