I'm using a MySQL NDB cluster with master-master architecture. My understanding is that if I search after some data non-id based this will hit all NDB nodes. If one node can't acquire the lock because the row is locked by another transaction and the wait time elapsed I will get a "Lock wait timeout" exception.
The application that connects to this DB is standard spring boot with hibernate(database-platform: org.hibernate.dialect.MySQL5InnoDBDialect database: MYSQL)
There are some transactions that are read-only. The transaction performing the read is good with before or after values (relative to other transaction). According to this if I don't add "LOCK IN SHARE MODE." this will happen naturally.
My method is annotated with: @Transactional(readOnly = true)
Is there something else I should do to make sure my application just reads without waiting or blocking another transaction?