Data access problems for Sybase data sources
This article provides troubleshooting tips for accessing Sybase data sources.
What kind of problem are you having accessing your Sybase database?
- "Sybase Error 7713: Stored Procedure can only be executed in unchained transaction mode" error
- "JZ0XS: The server does not support XA-style transactions. Please verify that the transaction feature is enabled and licensed on this server."
- A container managed persistence (CMP) enterprise bean is causing exceptions.
- Database deadlocks and XA_PROTO errors occur when using Sybase
- Sybase does not throw an exception when an incorrect database name is specified
"Sybase Error 7713: Stored Procedure can only be executed in unchained transaction mode" error
This error occurs when either:
- The JDBC attempts to put the connection in autocommit(true) mode.
- A stored procedure is not created in a compatible mode.
To fix the autocommit(true) mode problem, let the application change the connection to chained mode using the Connection.setAutoCommit(false) mode, or use a set chained on language command.
To resolve the stored procedure problem, use the sp_procxmode procedure_name "anymode" command.
"JZ0XS: The server does not support XA-style transactions. Please verify that the transaction feature is enabled and licensed on this server"
This error occurs when XA-style transactions are attempted on a server that does not have Distributed Transaction Management (DTM) installed.
To resolve this problem, use the instructions in the Sybase Manual titled: Use Adaptive Server Distributed Transaction Management Features to enable Distributed Transaction Management (DTM). The main steps in this procedure are:
- Install the DTM option.
- Check the license.dat file to verify that the DTM option is installed.
- Restart the license manager.
- Enable DTM in ISQL.
- Restart the ASE service.
Container managed persistence (CMP) enterprise bean is causing exceptions
This error is caused by improper use of reserved words. Reserved words cannot be used as column names.
To correct this problem: Rename the variable to remove the reserved word. We can find a list of reserved words in the Quick Reference Guide for Sybase Adaptive Server Enterprise 15.5. This manual is available online at: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc70202.1550/html/quickref/CACIGGEB.htm.
Database deadlocks and XA_PROTO errors occur when using Sybase
When using Sybase with the IBM WebSphere Application Server, do one of the following to prevent database deadlocks and errors:
- Change the transaction isolation level on the connection to TRANSACTION_READ_COMMITTED. Set the isolation level on the connection for unshareable connections or, for shareable connections, define the isolation levels in the resource reference for our data source using an assembly tool.
- Modify Sybase by doing one of the following:
- To use the existing tables, modify the table locking scheme using the alter table table name lock datarows command to get a row lock level granularity.
- If to set the system-wide locking scheme to data rows, all subsequently created tables inherit that value and have a locking scheme of data rows.
We must drop the original databases and tables.
Sybase does not throw an exception when an incorrect database name is specified
Verify that the database name is correctly entered on the data source properties.
Most databases (DB2, Oracle, Informix , S SQL Server and Apache Derby) throw an exception when the database specified does not exist. But Sybase does not throw an exception when an incorrect database name is specified. Sybase generates an SQL warning and then connects to the default database. If we misspell the requested database name, Sybase connects you to the master or the default database where the table you requested is not found.
If none of these steps fixes our problem, check to see if the problem has been identified and documented by looking at the available online support (hints and tips, technotes, and fixes). If we do not find our problem listed there, contact IBM Support.
Related:
Troubleshooting help from IBM Developing data access applications Data access problems Data access problems for Oracle data sources Data access problems for DB2 databases Data access problems for Microsoft SQL Server data sources Data access problems for Apache Derby databases Diagnose and fix problems: Resources for learning