This Genero BDL demo can be used to test SQL commands with two concurrent programs accessing the same database table rows. With this sample you can better learn the behavior of an SQL database engine when concurrent clients modify the same rows.
- Genero BDL 3.20+
- Genero Browser Client 1.00.52+
- Genero Desktop Client 3.20+
- Genero Studio 3.20+
- GNU Make
Before compiling, modify the program to connect to your database.
- make clean all
- make run
- Load the sqlconcur.4pw project
- Build the project
- Make sure to review the DB connection instruction to connect to your DB server.
- Start two instances of the sqlconcur program
- In instance A: create_table, insert_into x 5
- In instance A: begin_work, update_where (row=3) => sets lock
- In instance B: begin_work, update_where (row=3) => waits for lock (or error)
- In instance A: commit_work => unlocks row => instance B can do the UPDATE
- In instance B: commit_work => all updates done without conflict.
- Make sure to review the DB connection instruction to connect to your DB server.
- Start two instances of the sqlconcur program
- In instance A: create_table, insert_into x 5
- In instance A: begin_work, update_where (row=3) => sets lock
- In instance B: begin_work, update_where (row=3) => waits for lock (or error)
- In instance B: hit the interrupt button => error -216 (normal, user interruption)
- In instance A: commit_work => only one update is done.