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

From: TC <donotuse_at_donotuse.com>
Date: Fri, 28 Mar 2003 16:36:29 GMT
Message-ID: <hS_ga.260533$6b3.800773_at_rwcrnsc51.ops.asp.att.net>


Forgive my lack of experience with application development.

However, I was wondering whether can try using a function within the database and calling the function with the required parameters or try using prepared statements.

Just my 10c

//tc

"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
Received on Fri Mar 28 2003 - 17:36:29 CET

Original text of this message