Row Level Locking via JDBC
Posted in 2004
Topics: Error Codes & Troubleshooting, Connectivity: ODBC / JDBC / .NET
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
On Tue, 18 May 2004 08:55:15 -0400, S?ren Ehm wrote:
CREATE TABLE Dummy (
ID integer NOT NULL,
Counter integer
) LOCK MODE (ROW); -- Note the parenthesis!
Art S. Kagel
> 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