How to test multiple accesses to a table

Dear community,

I am interested in the following test case

function test_foo() {
    connectionOneToTable();
    connectionTwoToTable();
    connectionThreeToTable();

   // assert that values in the table are changed by only one connection
}

How can I simulate this case while testing?