Re: ORA-14551 when using select for update inside a java stored procedure

From: bung ho <bung_ho_at_hotmail.com>
Date: 31 Mar 2003 13:08:36 -0800
Message-ID: <567a1b1.0303311308.534307aa_at_posting.google.com>


Vasileios Lourdas <Vasileios.Lourdas_at_eurodyn.com> wrote in message news:<3E8469BF.72666276_at_eurodyn.com>...
> Hi.
>
> I have written a Java stored procedure in Oracle 8.1.6.1.0 Enterprise
> where i try to update a BLOB column. Oracle's documentation clearly
> states that prior to updating a LOB field, you must first get an
> exclusive lock for the row, using the select for update statement.
> Inside SQL*Plus, the statement of course works fine, but when executing
> the PL/SQL procedure that calls the JSP i get an ORA-14551 error. The
> code i use for locking the row is:
> ...
> Connection dbConn =
> DriverManager.getConnection("jdbc:default:connection:");
> dbConn.setAutoCommit(false);
> String lockStatement = "SELECT * FROM " + tableName + " WHERE ROWSEQNO="
> + String.valueOf(rowSequence) + " FOR UPDATE";
> OracleCallableStatement stmt =
> (OracleCallableStatement)dbConn.prepareCall(lockStatement);
> stmt.execute();
> ...
> I have tried this using either an OracleStatement object or any object i
> could think of and i always get the same error.
>
> How can i solve this issue? Could it be a 8.1.6 bug?
>
> Regards,
> Vasilis

what is the code that calls this stored procedure? and what is the full text of the CREATE PROCEDURE statement? Received on Mon Mar 31 2003 - 23:08:36 CEST

Original text of this message