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

Auto-commit VS Auto-start #158

Open
guyilin-amazon opened this issue Sep 3, 2021 · 0 comments
Open

Auto-commit VS Auto-start #158

guyilin-amazon opened this issue Sep 3, 2021 · 0 comments

Comments

@guyilin-amazon
Copy link
Contributor

If the auto_commit mode is turned on, the Shell will execute each statement as individual transaction implicitly, which means we do not need to explicitly type begin and commit before statements. Example:

qldb> select * from foo
+-----+
| foo |
+=====+
| bar |
+-----+
1 document in bag (read-ios: 1, server-time: 11ms, total-time: 155ms)
qldb>  <-- transaction opened and committed implicitly

There are some suggestions that instead open and commit the transaction automatically, we could just open the transaction but don't commit it. In other words, after we type a statement, the Shell will enter transaction mode for following statements, and we need to type commit or abort explicitly to end the transaction. The output would be like following:

qldb> select * from foo
+-----+
| foo |
+=====+
| bar |
+-----+
1 document in bag (read-ios: 1, server-time: 11ms, total-time: 155ms)
qldb *> <-- entered transaction mode, need to type commit or abort to end the transaction

That will give user more control about the transaction workflow and we could then rename the auto_commit to auto_start to better align the situation.

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