Re: Sybase adapter changes?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 30 2006 - 10:33:29 EDT

  • Next message: Gentry, Michael \(Contractor\): "RE: Sybase adapter changes?"

    IIRC transaction API changes also happened around M12.

    Andrus

    On Jun 30, 2006, at 3:19 PM, Gentry, Michael ((Contractor)) wrote:

    > M9: Pass (auto-commit = true)
    > M10: Pass (auto-commit = true)
    > M11: Pass (auto-commit = true)
    > M12: Fail (auto-commit = false)
    > RC1: Fail (auto-commit = false)
    >
    > Well, at least that provides a good starting point. :-)
    >
    > /dev/mrg
    >
    >
    > -----Original Message-----
    > From: Gentry, Michael (Contractor)
    > [mailto:michael_gentr..anniemae.com]
    >
    > Sent: Friday, June 30, 2006 9:47 AM
    > To: cayenne-de..ncubator.apache.org
    > Subject: RE: Sybase adapter changes?
    >
    >
    > Well, I don't really have DBA access (create table/etc) to any of our
    > Sybase servers. There *might* be a development database server
    > somewhere I could try it on. I'll ask around.
    >
    > On another note ...
    >
    > Installed 1.2 RC2 and ran the application. Same exception.
    >
    > Installed 1.2 M9 and ran the application. Generated primary key.
    >
    > So, something has definitely changed between those releases, but
    > I'm not
    > sure what. I'm not even really using Cayenne in the key generator (I
    > get the JDBC connection and call it directly).
    >
    > /dev/mrg
    >
    > PS. I might try installing all the releases between the two and see
    > where the breaking point is.
    >
    >
    >
    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: Friday, June 30, 2006 3:57 AM
    > To: cayenne-de..ncubator.apache.org
    > Subject: Re: Sybase adapter changes?
    >
    >
    > This may be something related to the changes in the rest of Cayenne
    > (such as transaction code). I've been having problems with my Linux
    > Sybase installation lately (and it is not yet supported on Fedora
    > Core 5, so I can't put it on our new server), so the last few
    > releases haven't been tested on Sybase.
    >
    > Can you run Cayenne unit tests against Sybase and see if it generates
    > any failures?
    >
    > Andrus
    >
    > On Jun 29, 2006, at 10:27 PM, Gentry, Michael ((Contractor)) wrote:
    >> I have an application running fine "in production" using Cayenne
    >> 1.2M9,
    >> but when testing it locally with Cayenne 1.2 RC1, I get this
    >> exception:
    >>
    >> Exception = com.sybase.jdbc2.jdbc.SybSQLException: Stored procedure
    >> 'getpid' may be run only in unchained transaction mode. The 'SET
    >> CHAINED
    >> OFF' command will cause the current session to use unchained
    >> transaction
    >> mode.
    >>
    >> I didn't make any changes to the Cayenne portion, just twiddled a few
    >> Tapestry bits and was testing the application out. The error occurs
    >> when I insert a record and need a primary key -- I call a stored
    >> procedure directly using JDBC in my custom PK class (which has been
    >> working perfectly for over a year):
    >>
    >> public Object generatePkForDbEntity(DataNode dataNode, DbEntity
    >> ent)
    >> throws Exception
    >> {
    >> // Get our connection so we can call the stored procedure
    >> Connection connection =
    >> dataNode.getDataSource().getConnection();
    >> CallableStatement getPID = connection.prepareCall("{call
    >> getpid(?,?,?)}");
    >>
    >> // Prepare the stored procedure
    >> getPID.setInt(1, currentBlockSize); // Slot 1:
    >> Number of
    >> PIDs requested
    >> getPID.registerOutParameter(2, Types.BINARY); // Slot 2: First
    >> PID
    >> allocated
    >> getPID.registerOutParameter(3, Types.INTEGER); // Slot 3:
    >> Number of
    >> PIDs allocated
    >> try
    >> {
    >> // Call the stored procedure
    >> getPID.execute();
    >> ...
    >>
    >> I get the exception on the execute() line.
    >>
    >> I did diffs on the Sybase code, but didn't see any changes -- at
    >> least
    >> not since it was converted to Subversion.
    >>
    >> Anyone have ideas?
    >>
    >> Thanks!
    >>
    >> /dev/mrg
    >>
    >> PS. Auto commit is false.
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Jun 30 2006 - 10:33:53 EDT