![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have problems to set up Row Level Locking for my DB Connect. Following Source Code produces the error code: "Could not do a physical-order read to fetch next row." Here is the sql statement for the table. CREATE TABLE Dummy ( ID integer NOT NULL, Counter integer ) LOCK MODE ROW; And here is the part of the program. { st = conn1.createStatement(); st.executeUpdate("insert into dummy values (1, 1)"); st = conn1.createStatement(); st.executeUpdate("insert into dummy values (2, 2)"); conn1.commit(); conn2.commit(); st = conn1.createStatement(); st.executeUpdate("update dummy set counter = 3 where id = 1"); st = conn2.createStatement(); st.executeUpdate("update dummy set counter = 3 where id = 2"); conn1.commit(); conn2.commit(); } Maybe you can help me. Thanks in advance Soeren Ehm |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
More precisely, I set row level locking in the table dummy. CREATE TABLE Dummy ( ID integer NOT NULL, Counter integer ) LOCK MODE ROW; The focus is laying on the following update statements. Why I can't update different rows in the same table by two connections which simulating two clients. conn1.setAutoCommit(false); conn2.setAutoCommit(false); st = conn1.createStatement(); st.executeUpdate("update dummy set counter = 3 where id = 1"); st = conn2.createStatement(); st.executeUpdate("update dummy set counter = 3 where id = 2"); conn1.commit(); conn2.commit(); I don't understand, why I get the error message - "Could not do a to fetch next row.". Normally, this could't be right with row level locking. Soeren |
#5
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |