I have a SQL query, like so:
UPDATE warehouses SET warehouse_spec =
UPDATEXML(warehouse_spec,
'/Warehouse/Docks/text()',4)
WHERE warehouse_name = 'San Francisco';
(Taken directly from Oracle)
Sql developer executed a query exactly like so (sans the parameters), and was successful.
I pass the same query to JDBC to run, but the function ran without stopping. Knowing that I have configured the JDBC connection to the db correctly, what could be the problem?
Sql developer executed a query exactly like so (sans the parameters), and was successful.
I pass the same query to JDBC to run, but the function ran without stopping. Knowing that I have configured the JDBC connection to the db correctly, what could be the problem?
The row that you are trying to modify has been UPDATE
d by the SQL Developer session but that session has not issued a COMMIT
or ROLLBACK
so the row is locked and the other (JDBC) session is waiting for the lock to be released.
Try running the JDBC code and if the code is waiting "forever" then go to SQL Developer (or whichever tool you have that has an open session with uncommitted data) and run the COMMIT
(or ROLLBACK
) command and see if the JDBC code then suddenly completes. If it does then it was waiting for the lock to be released on the row.