"xixi" <dai_xi@yahoo.com> wrote in message
news:c0f33a17.0404160808.3552ae51@posting.google.c om...[color=blue]
> my concern is the behavior of DB2 is different on different size of
> table, if i have only one row in the table, and while this row being
> updated, simply after stm.executeUpdate(sql), the row U lock becomes X
> lock, instead of release the lock, i have to do cursor.close() (cursor
> is the resultset which create the row U lock ) and connection.commit()
> to release the X lock (even auto commit is true) , but if the table
> has more than one row, after stm.executeUpdate(sql) will release the
> row U lock right away, so that is the problem i try to understand.[/color]
If you're using Perl DBI or CLI to access the database, your cursor is
probably being created implicitly using the WITH HOLD option. This means
that the locks are released when you close the cursor, instead of when you
commit.
You will want to look at the CURSORHOLD configuration option, described
here:
http://publib.boulder.ibm.com/infoce...d/r0008781.htm
The locking characteristics of DB2 also change depending on your isolation
level, especially with cursors. CS isolation is the default when using Perl
DBI or CLI.
You can read more about isolation levels here:
http://publib.boulder.ibm.com/infoce...n/c0004121.htm
--
Matt Emmerton
DB2 OLTP Performance
IBM Toronto Lab