"com.sybase.jdbc2.jdbc.SybSQLException: Stored procedure 'xxx' maybe run only in unchained transaction mode" thrown when Sybase stored procedure called from WebSphere Application Server 4.0.x
 Technote (FAQ)
 
Problem
When an application running in WebSphere® Application Server 4.0.x calls a Sybase® stored procedure in unchained (autocommit) mode, the following exception is issued:

com.sybase.jdbc2.jdbc.SybSQLException: Stored procedure 'xxx' maybe run only in unchained transaction mode
 
Cause
In Sybase, a stored procedure can be defined in either chained or unchained mode. When it is in unchained mode, AutoCommit must be set to true to ensure that the connection is also in unchained mode.
 
Solution
There are two ways to resolve the problem:
  1. Run the Sybase isql command:

    sp_procxmode <procedure_name>,"anymode"

    This command causes the stored procedure to ignore whether it is run in chained or unchained mode. The exception is not issued.

  2. Call the method setAutoCommit(true) on the connection object. The setAutoCommit() method cannot be called within a transaction. If it is done within an EJB™, the EJB method must have the transaction attribute of TX_NOT_SUPPORTED so that it is called without a transaction context.

Running stored procedures in unchained mode is not recommended. If any of the statements in the stored procedure fail, the transaction cannot be rolled back to a known state because some statements in the stored procedure are already committed.

 
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1137019
IBM Group: Software Group
Modified date: Sep 7, 2004