Sunday, February 26, 2012

ERROR : FOR UPDATE cannot be specified on a READ ONLY ...

Hi All,
I am using SQL Server 2000 + JDeveloper 10g with ADF.
When i try to make changes to data and do COMMIT, I receive ERROR, I
have tried both JDBC Driver from Microsoft and jTDS, both FAILS.
Here is the error :
With Microsoft JDBC Driver :
(oracle.jbo.DMLException) JBO-26080: Error while selecting entity for
Departments
-- LEVEL 1: DETAIL 0 --
(java.sql.SQLException) [Microsoft][SQLServer 2000 Driver for
JDBC][SQLServer] FOR UPDATE cannot be specified on a READ ONLY cursor.
With jTDS JDBC Driver :
(oracle.jbo.DMLException) JBO-26080: Error while selecting entity for
Departments
-- LEVEL 1: DETAIL 0 --
(java.sql.SQLException) Line 1: FOR UPDATE clause allowed only for
DECLARE CURSOR.
Pls any body help...
Thank you,
Krist
Quite simple, really. SQL Server does not support FOR UPDATE; at least
not in the way that Oracle does. It's not standard SQL.
Alin,
The jTDS Project.
|||Hi ,
Thank you for your reply, it works now if I use JDBC driver from
Microsoft.
But if I use jTDS JDBC Driver, I get this error :
(oracle.jbo.DMLException) JBO-26041: Failed to post data to database
during "Update": SQL Statement
"UPDATE dbo.DEPARTMENTS SET DEPARTMENT_NAME=? WHERE DEPARTMENT_ID=?".
-- LEVEL 1: DETAIL 0 --
(java.sql.SQLException) Invalid parameter index 1.
Is there any options /setting on jDTS diver that I miss ?
Thank you for your help,
Krist
|||xtanto@.hotmail.com wrote:
> Hi ,
> Thank you for your reply, it works now if I use JDBC driver from
> Microsoft.
> But if I use jTDS JDBC Driver, I get this error :
> (oracle.jbo.DMLException) JBO-26041: Failed to post data to database
> during "Update": SQL Statement
> "UPDATE dbo.DEPARTMENTS SET DEPARTMENT_NAME=? WHERE DEPARTMENT_ID=?".
> -- LEVEL 1: DETAIL 0 --
> (java.sql.SQLException) Invalid parameter index 1.
> Is there any options /setting on jDTS diver that I miss ?
What does this have to do with FOR UPDATE?
Alin.
|||Hi Alin,
I am sorry, yes FOR UPDATE problem already solved after I upgrade to
JDev 10.1.2 and Oracle fix the problem by generating the correct sql
syntax for sqlserver.
However I still have problem with jTDS (described above).
I also post this in jTDS forum.
Thank you,
Krist
|||Could you enable DriverManager logging just before executing the code
that generates the exception and post the resulting log dump?
Alin.

No comments:

Post a Comment