You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ron Gavlin <rg...@yahoo.com> on 2007/06/18 19:01:00 UTC

Tuscany DAS M2 Exception with default useGetGeneratedKeys = true

Greetings,

I am having problems inserting rows with Tuscany DAS M2 using the BEA WebLogic Sybase JDBC driver (BEA WebLogic 8.1). The code below generates the following stacktrace:

...
Command insert = das.createCommand("insert into Test (testCol1, testCol2) values (?, ?)");
insert.setParameter(1, "str1");
insert.setParameter(2, "str2");
insert.execute();

Stacktrace:

Caused by: java.sql.SQLException: [BEA][Sybase JDBC Driver]No rows affected.
    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
    at weblogic.jdbc.base.BaseException.getException(Unknown Source)
    at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:159)
    at org.apache.tusany.das.rdb.impl.Statement.executeUpdate(Statement.java:173)
    at org.apache.tusany.das.rdb.impl.Statement.executeUpdate(Statement.java:133)

    at org.apache.tusany.das.rdb.impl.InsertCommandImpl.execute(InsertCommandImpl.java:44)



While interactively debugging org.apache.tuscany.das.rdb.impl.ConnectionImpl.prepareStatement(String queryString, String[] returnKeys), I noticed if I manually change the boolean member variable useGetGeneratedKeys to false, no exception is generated and the insert works as designed. What is the correct fix here?

- Ron



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Tuscany DAS M2 Exception with default useGetGeneratedKeys = true

Posted by Amita Vadhavkar <am...@gmail.com>.
 Please check if the driver you are using is supporting
connection.prepareStatement(queryString, Statement.*RETURN_GENERATED_KEYS*);


Regards,
Amita

On 6/18/07, Ron Gavlin <rg...@yahoo.com> wrote:
>
> Greetings,
>
> I am having problems inserting rows with Tuscany DAS M2 using the BEA
> WebLogic Sybase JDBC driver (BEA WebLogic 8.1). The code below generates
> the following stacktrace:
>
> ...
> Command insert = das.createCommand("insert into Test (testCol1, testCol2)
> values (?, ?)");
> insert.setParameter(1, "str1");
> insert.setParameter(2, "str2");
> insert.execute();
>
> Stacktrace:
>
> Caused by: java.sql.SQLException: [BEA][Sybase JDBC Driver]No rows
> affected.
>    at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
>    at weblogic.jdbc.base.BaseException.getException(Unknown Source)
>    at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown
> Source)
>    at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown
> Source)
>    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(
> PreparedStatement.java:159)
>    at org.apache.tusany.das.rdb.impl.Statement.executeUpdate(
> Statement.java:173)
>    at org.apache.tusany.das.rdb.impl.Statement.executeUpdate(
> Statement.java:133)
>
>    at org.apache.tusany.das.rdb.impl.InsertCommandImpl.execute(
> InsertCommandImpl.java:44)
>
>
>
> While interactively debugging
> org.apache.tuscany.das.rdb.impl.ConnectionImpl.prepareStatement(String
> queryString, String[] returnKeys), I noticed if I manually change the
> boolean member variable useGetGeneratedKeys to false, no exception is
> generated and the insert works as designed. What is the correct fix here?
>
> - Ron
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>