Re: two sybase related issues

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jul 26 2005 - 17:57:28 EDT

  • Next message: Kevin Menard: "Re: Question Concerning XML - Was: M5 is out"

    > first:
    > When I call a stored procedure that return one ResultSet I don't get the
    > result. (the procedure doesn't update anything)
    >
    > Due to fix of CAY-271 the behavior of the method performAction in
    > ProcedureAction doesn't work for me anymore.
    >
    > The return value of the execute method indicate the form of the first
    > ResultSet. (see JDK API )
    > So, depend from the return of the execute method the ResultSet should be
    > read appropriate as updateCount or as Result.
    > it seems the getMoreResults is not reliable directly past the execute call

    Could you please open a bug report with a sample stored procedure DDL.

    We should definitely add more stored procedure cases to our test suite.
    Differences in handling stored procedure results by different drivers is
    one of those nasty hidden JDBC gotchas...oh well, we'll try to do
    something about it.

    Also I must admit that I don't do much testing with jTDS driver (even
    though it is often superior to Sybase and MS drivers)... Might be a good
    idea to start doing it consistently.

    > second:
    >
    > the sql type TINYINT is in sybase defined in a range from 0 up to 255
    > If I do a SQLTemplate query cayenne creates an RowDesriptor from the
    > ResultSet using the column type (-6) then map it to Byte.
    > As long the value is less 128 its OK. But when the value is greater than
    > 127 the value is wrong.
    > In MySQL it's also possible to define an unsigned tinyint (0-255).
    >
    > So, I think it's better to map tinyint to Short at least.

    I see no reason to change default mapping between JDBC tinyint and Java
    byte - this follows JDBC standard verbatim. If a driver returns JDBC
    tinyint for the type that doesn't fit in it, I'd say this is a driver bug.

    Of course you'll still have to handle this somehow. Try using #result()
    directive in your SQLTemplate
    (http://objectstyle.org/cayenne/userguide/fetch/sqltemplate-scripting.html)
    to remap a tinyint column to java.lang.Short.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Jul 26 2005 - 17:57:29 EDT