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.