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

Automatically restart transactions on deadlock #620

Closed
jniles opened this issue Aug 3, 2016 · 0 comments · Fixed by #621
Closed

Automatically restart transactions on deadlock #620

jniles opened this issue Aug 3, 2016 · 0 comments · Fixed by #621
Assignees

Comments

@jniles
Copy link
Collaborator

jniles commented Aug 3, 2016

The best practice with database connections is to restart transactions in case of transactions locks. In 2.x's database connector, we could easily check if the MYSQL error code ER_LOCK_DEADLOCK is set, and restart the transactions a set number of times, configurable in the transaction.js library.

@IMA-WorldHealth/local-contributors what do you think?

@jniles jniles added this to the Future milestone Aug 3, 2016
jniles pushed a commit to jniles/bhima that referenced this issue Aug 4, 2016
This commit removes the highlighting feature for the time being, until
there is an actual use case for it.

It also temporarily skips the reference lock test until transaction
restarts are implemented.  See IMA-WorldHealth#620.
@jniles jniles self-assigned this Aug 4, 2016
jniles pushed a commit to jniles/bhima that referenced this issue Aug 4, 2016
This commit implements automatic retrying of transactions when a
transaction deadlock occurs.  This allows the server to handle up to 20
simultaneous patient registrations!  The integration tests have been
updated accordingly to stress the server.

The number of retries is currently 3, but is configurable via the
MAX_TRANSACTION_DEADLOCK_RESTARTS constant in the transaction library.

Closes IMA-WorldHealth#620.
jniles pushed a commit to jniles/bhima that referenced this issue Aug 4, 2016
This commit implements automatic retrying of transactions when a
transaction deadlock occurs.  This allows the server to handle up to 20
simultaneous patient registrations!  The integration tests have been
updated accordingly to stress the server.

The number of retries is currently 3, but is configurable via the
MAX_TRANSACTION_DEADLOCK_RESTARTS constant in the transaction library.

Closes IMA-WorldHealth#620.
jniles pushed a commit to jniles/bhima that referenced this issue Aug 4, 2016
This commit implements automatic retrying of transactions when a
transaction deadlock occurs.  This allows the server to handle up to 20
simultaneous patient registrations!  The integration tests have been
updated accordingly to stress the server.

The number of retries is currently 3, but is configurable via the
MAX_TRANSACTION_DEADLOCK_RESTARTS constant in the transaction library.

Closes IMA-WorldHealth#620.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant