Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8144799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:28:41+00:00 2026-06-06T13:28:41+00:00

I am working on Spring-Hibernate-Websphere application and sybase as database. Following is the code

  • 0

I am working on Spring-Hibernate-Websphere application and sybase as database. Following is the code snippet to configure Spring/Hibernate to refer to JNDI datasource of Websphere.

    <?xml version="1.0" encoding="UTF-8"?>
    <beans  xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">


<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/icpDS" />
    <property name="lookupOnStartup" value="false" />
    <property name="cache" value="true" />
    <property name="proxyInterface" value="javax.sql.DataSource" />
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan" value="com.ubs.research.icp.hibernate.object" />
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
        </props>
    </property>
</bean>
<tx:annotation-driven />
<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/>

Here are the values for the properties used in above code:

hibernate.dialect=org.hibernate.dialect.SybaseDialect
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.connection.autocommit=false
hibernate.max_fetch_depth=0

Above configuration works fine while using some simple queries, and I can see those hibernate generated queries on console. However, while executing some complex queries (with multiple joins), I find exception cased by below exception.

[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R Caused by: java.sql.SQLException: JZ0PA: The query has been cancelled and the response discarded.  The cancel was probably issued by another statement on the connection.
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at com.sybase.jdbc3.jdbc.SybStatement.getUpdateCount(Unknown Source)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.closeWrapper(WSJdbcPreparedStatement.java:479)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:240)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:193)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:534)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:269)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:285)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:212)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.Loader.doQuery(Loader.java:726)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.Loader.doList(Loader.java:2213)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.Loader.list(Loader.java:2099)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
[6/25/12 13:31:00:357 EDT] 0000002f SystemErr     R     at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)

What may be causing this error? Any pointers greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:28:44+00:00Added an answer on June 6, 2026 at 1:28 pm

    The problem was resolved with the installation of the Websphere Fixpack 7.0.0.13+ (We installed 7.0.0.21). The problem lied in handling of the getUpdateCount() from websphere. When a prepared statement is created (in our case by Hibernate), and before execution, if getUpdateCount() is called, Syabase (and informix as per IBM support), throws SQLException while other databases simply return -1. This was not handled from Websphere and the exeception was propogated to the application code. With the fixpack, this is handled and problem is resolved.

    More reading here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've try to implement integration tests for a working application (spring, hibernate, soap, cxf).
I am working on an application using Spring 3 and Hibernate 3.5 with Java
I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and
I'm working on a web application with Wicket, Spring and Hibernate and I've come
I'm working on a REST application with Spring-data Hibernate etc.. I've setup all my
The environment of my application: web-based, Spring MVC+Security, Hibernate, MySQL(InnoDB) I am working on
I am working on a Spring application (Spring 3.0) and following layered architecture i.e.
I'm working on a Flex/BlazeDS/Spring/JPA/Hibernate web application hooked up to a Microsoft SQL Server
I have an application using Spring with Hibernate on a MySQL database. For some
I have a Spring/Hibernate web application (currently working fine on Tomcat) that I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.