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 9209679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:54:06+00:00 2026-06-18T00:54:06+00:00

My java app deployed in jboss AS 7, queries a MS SQL server database

  • 0

My java app deployed in jboss AS 7, queries a MS SQL server database using spring data. I also need to call a DB2 function on zOS for which I use Spring JdbcTemplate. The SQL is:

public String getUniqueId()
{
    String sql = "SELECT " + schemaName + ".SGB_LON_ID_NEXT() FROM SYSIBM.SYSDUMMY1" ;
    return (jdbcTemplate.queryForLong(sql));
}

Unit tests in Eclipse work fine.
When I deploy in the jboss server, the first call works.
However, the second transaction onwards, the call itself works, but a few warnings appear in the server.log for each call.

I wonder if it could be the fact that the JDBC call is NOT a part of the JPA transaction. (note that the jdbc call is a simple – the DB2 function just returns the next serial number for a field )

Here are the warning messages from the error stack:

        21:50:33,955 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (http-/127.0.0.1:8080-14) 
        Destroying connection that is not valid, due to the following exception: com.ibm.db2.jcc.t4.b@1167bd5: com.ibm.db2.jcc.am.SqlSyntaxErrorException: 
        DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=<END-OF-STATEMENT>;MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MIN, DRIVER=3.63.123


        21:50:34,096 WARN  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (http-/127.0.0.1:8080-14) 
        IJ000305: Connection error occured:org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@f79f0f[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@136e43e connection handles=0 lastUse=1359255001136 trackByTx=false 
        pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@c2c2de pool internal context=SemaphoreArrayListManagedConnectionPool@8793c7[pool=DB2_zOS_DS] 
        xaResource=LocalXAResourceImpl@f70194[connectionListener=f79f0f connectionManager=112dadb warned=false currentXid=null] txSync=null]: 
        com.ibm.db2.jcc.am.SqlSyntaxErrorException: 
        DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=<END-OF-STATEMENT>;MICROSECONDS MICROSECOND SECONDS SECOND MINUTES MIN, DRIVER=3.63.123


        21:50:34,196 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (http-/127.0.0.1:8080-14) 
        IJ000612: Destroying connection that could not be successfully matched: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@f79f0f[state=DESTROYED managed connection=
        org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@136e43e connection handles=0 lastUse=1359255001136 trackByTx=false 
        pool=org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri@c2c2de pool internal context=SemaphoreArrayListManagedConnectionPool@8793c7[pool=DB2_zOS_DS] 
        xaResource=LocalXAResourceImpl@f70194[connectionListener=f79f0f connectionManager=112dadb warned=false currentXid=null] txSync=null]

Any suggestions on how to fix?
I am not clear on how to add the JDBC call to the current transaction (JPA). Or should it be a separate transaction. As stated earlier the jdbc call is a db2 function that returns the next value for a sequence number.

  • 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-18T00:54:07+00:00Added an answer on June 18, 2026 at 12:54 am

    The problem turned out to be in my datasource setup in JBOSS_HOME/standalone/configuration/standalone.xml.

    In the validation section, I had this which was incorrect.

    <validation>
        <check-valid-connection-sql>select 1</check-valid-connection-sql>
    <validation>
    

    The above was incorrect and DB2 was giving a validation error.

    I changed that to the following instead:

          <validation>
              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
              <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker"/>
              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
          </validation>
    

    Here is the complete datasource set up in case anybody else finds it useful.

        <datasource jndi-name="java:jboss/datasources/DB2_zOS_DS" pool-name="DB2_zOS_DS" enabled="true" use-java-context="true">
          <connection-url>jdbc:db2://MyHostName:MyPortNo/MyDBQA1:currentSchema=MySchemaQA1;</connection-url>
          <driver>db2zOS</driver>
          <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
          <pool>
              <min-pool-size>9</min-pool-size>
              <max-pool-size>50</max-pool-size>
              <prefill>true</prefill>
              <allow-multiple-users/>
          </pool>
          <security>
              <user-name>MY-APP-ID</user-name>
              <password>My-APP-ID-PASSWORD</password>
          </security>
          <validation>
              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
              <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker"/>
              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
          </validation>
          <timeout>
              <set-tx-query-timeout>true</set-tx-query-timeout>
              <blocking-timeout-millis>500</blocking-timeout-millis>
              <idle-timeout-minutes>15</idle-timeout-minutes>
          </timeout>
          <statement>
              <track-statements>false</track-statements>
              <prepared-statement-cache-size>32</prepared-statement-cache-size>
              <share-prepared-statements>true</share-prepared-statements>
          </statement>
        </datasource>
        <drivers>
          <driver name="db2zOS" module="com.ibm.db2">
              <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
          </driver>
        </drivers>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Java/Spring app deployed into Heroku, using the excellent webapp-runner as the
At first i deployed a Java application in an app server running on JBoss.
I'm trying to use Spring to configure a web app deployed in JBoss. I've
I have a Java web app using JDBC created in NetBeans deployed to Tomcat
I'm using sun java app server 8.0 PE, I have created webapplication and added
I have a Web App deployed on JBoss App Server 7.0.2 on Windows XP
Hi i am using spring for android with an app server jboss6 , in
I've got a Java web app (WAR) deployed to Tomcat on a remote Solaris
I am using a Java app to read thru text files and output them
I am programming a Java app in which i need to constantly check that

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.