From b294eaf5f7b79c4591d92ced8a090bd43bd93c50 Mon Sep 17 00:00:00 2001 From: YasmineZouari <81264035+YasmineZouari@users.noreply.github.com> Date: Wed, 24 Mar 2021 00:52:38 +0100 Subject: [PATCH] Update ReadMe.md --- tp2/ReadMe.md | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/tp2/ReadMe.md b/tp2/ReadMe.md index 5a6d315..e1ea17d 100644 --- a/tp2/ReadMe.md +++ b/tp2/ReadMe.md @@ -82,15 +82,15 @@ Biensûr, lorsqu'on parle de gestion de conccurence entre plusieurs transactions | Timing | Session N° 1 (User1) | Session N° 2 (User2) |Résultat | | :----: | :----: |:----:|:----:| -| t0 | ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||| -| t1 | ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|------| -| t2 | ------ |```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```|------| -| t3 | ```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```|------| +| t0 | ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||S1:Mohammed's salary 2000 , hichem's 2800| +| t1 | ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|S1:updating hichem's salary| +| t2 | ------ |```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```|S2:Updating mohammed's salary| +| t3 | ```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```|S1:Updating blocked| | t4 | ------ |```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Hichem';```|La session 1 va detecter l'interblocage | | t5 | ```Commit;``` |------| Session 2: --> 1 row updated.| -| t6 |```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```| ------|------| -| t7 | ------ |```Commit;```| --------| -| t8 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| +| t6 |```UPDATE EMP SET SAL = SAL + 1000 WHERE ENAME ='Mohamed';```| ------|Updating blocked| +| t7 | ------ |```Commit;```|Session 1: --> 1 row updated. | +| t8 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S2:Mohammed's salary 3000 , hichem's 5000| ## Concurrence : Niveaux d'isolation des transactions @@ -116,18 +116,18 @@ Autrement dit, le développeur déclare qu’une lecture va être suivie d’une | Timing | Session N° 1 | Session N° 2 |Résultat | | :----: | :----: |:----:|:----:| -| t0| ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||| -| t1 | ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|------| -| t2 | ------ |```SET TRANSACTION ISOLATION LEVEL READ COMMITTED;```|------| -| t3 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');```|------| -| t4 | ------ |```UPDATE EMP SET SAL = 3800 WHERE ENAME ='Mohamed';```|------| -| t5 | ```Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,COMM,DEPTNO) values ('9999','Maaoui','Magician',null,to_date('17/02/2021','DD/MM/RR'),null,'10');``` |------|------| -| t6 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| -| t7 | ------ |```UPDATE EMP SET SAL = 5000 WHERE ENAME ='Hichem';```|------| -| t8 | ```Commit;``` |------|------| -| t9 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| -| t10| ------ |```COMMIT;```|------| -| t11| ```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------|------| +| t0| ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||S1:Mohammed's salary 2000 , hichem's 2800| +| t1 | ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|S1:1row Updated| +| t2 | ------ |```SET TRANSACTION ISOLATION LEVEL READ COMMITTED;```|S2:transacrtion defined| +| t3 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');```|S1:Mohammed's salary 2000 , hichem's 2800| +| t4 | ------ |```UPDATE EMP SET SAL = 3800 WHERE ENAME ='Mohamed';```|S2:1row updating| +| t5 | ```Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,COMM,DEPTNO) values ('9999','Maaoui','Magician',null,to_date('17/02/2021','DD/MM/RR'),null,'10');``` |------|S1:1 row created| +| t6 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S1:Mohammed's salary 3800 , hichem's 2800 , maaoui null| +| t7 | ------ |```UPDATE EMP SET SAL = 5000 WHERE ENAME ='Hichem';```|Updating blocked| +| t8 | ```Commit;``` |------|S2:1row updated| +| t9 | ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S2:Mohammed's salary 3800 , hichem's 5000 , maaoui null| +| t10| ------ |```COMMIT;```|Commit complete| +| t11| ```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------|S1:Mohammed's salary 3800 , hichem's 5000 , maaoui null| @@ -136,30 +136,30 @@ Autrement dit, le développeur déclare qu’une lecture va être suivie d’une | Timing | Session N° 1 | Session N° 2 |Résultat | | :----: | :----: |:----:|:----:| -| t0| ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||| -| t1| ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|------| -| t2| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|------| -| t3| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');```|------| -| t4| ------ |```UPDATE EMP SET SAL = 3800 WHERE ENAME ='Mohamed';```|------| -| t5| ```Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,COMM,DEPTNO) values ('9999','Maaoui','Magician',null,to_date('17/02/2021','DD/MM/RR'),null,'10');``` |------|------| -| t6| ```COMMIT;```|------ |------| -| t7|```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```| ------ |------| -| t8| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| -| t9| ```Commit;``` |------|------| -| t10|```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```| ------ |------| -| t11| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| -| t12| ------ | ```COMMIT;```|------| -| t13| ``` UPDATE EMP SET SAL = 5000 WHERE ENAME ='Maaoui'; ``` |------|------| -| t14| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|------| -| t15| ------ |```UPDATE EMP SET SAL = 5200 WHERE ENAME ='Maaoui';```|------| -| t16| ```COMMIT;``` |------|------| -| t17| ------ |```ROLLBACK;```|------| -| t18| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|------| -| t19| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| -| t20| ``` UPDATE EMP SET SAL = 5200 WHERE ENAME ='Maaoui'; ``` |------|------| -| t21| ```COMMIT;``` |------|------| -| t22| ------ | ```COMMIT;```|------| -| t23| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|------| +| t0| ``` SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');``` ||S1:Mohammed's salary 2000 , hichem's 2800| +| t1| ``` UPDATE EMP SET SAL = 4000 WHERE ENAME ='Hichem'; ``` |------|S1:1row updated| +| t2| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|transaction defined| +| t3| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem');```|S2:Mohammed's salary 2000 , hichem's 2800| +| t4| ------ |```UPDATE EMP SET SAL = 3800 WHERE ENAME ='Mohamed';```|S2:1row updated| +| t5| ```Insert into EMP (EMPNO,ENAME,JOB,MGR,HIREDATE,COMM,DEPTNO) values ('9999','Maaoui','Magician',null,to_date('17/02/2021','DD/MM/RR'),null,'10');``` |------|S1:1row created| +| t6| ```COMMIT;```|------ |Commit complete| +| t7|```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```| ------ |S1:Mohammed's salary 3800 , hichem's 4000, maaoui null| +| t8| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S2:Mohammed's salary 2000 , hichem's 3800, maaoui null| +| t9| ```Commit;``` |------|commit complete| +| t10|```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```| ------ |S1:Mohammed's salary 3800 , hichem's 4000, maaoui null| +| t11| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S2:Mohammed's salary 2000 , hichem's 3800, maaoui null| +| t12| ------ | ```COMMIT;```|commit complete| +| t13| ``` UPDATE EMP SET SAL = 5000 WHERE ENAME ='Maaoui'; ``` |------|S1:1row updated| +| t14| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|transaction defined| +| t15| ------ |```UPDATE EMP SET SAL = 5200 WHERE ENAME ='Maaoui';```|Updated blocked| +| t16| ```COMMIT;``` |------|S1:commit complete , s2:updating canceled | +| t17| ------ |```ROLLBACK;```|Rollback complete| +| t18| ------ |```SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;```|S2: transaction defined| +| t19| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S2:Mohammed's salary 3800 , hichem's 4000, maaoui 5000| +| t20| ``` UPDATE EMP SET SAL = 5200 WHERE ENAME ='Maaoui'; ``` |------|s1:1row updated| +| t21| ```COMMIT;``` |------|S1:commit complete| +| t22| ------ | ```COMMIT;```|S2:commit complete| +| t23| ------ |```SELECT ENAME, SAL FROM EMP WHERE ENAME IN ('Mohamed','Hichem', 'Maaoui');```|S1:Mohammed's salary 3800 , hichem's 4000, maaoui 5200|