473,626 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLSTATE 25501 invoking SPs from a J2EE DataSource connection

We are running into some problems with the execution of DB2 stored
procedures when their isolation level is set to:

set transaction isolation level READ UNCOMMITTED, READ WRITE;

This is a web application running in JBoss 4.0.1 where a standard
DataSource in JBoss is defined for connections against a DB2 database
on an AS/400 (VRM = V5R2M0). The driver is established as: <driver-
class>com.ibm.a s400.access.AS4 00JDBCDriver</driver-class>, we are
using JTOpen 5.4.

The data source provides connections fine, we ask the data source to
give us a connection and then the connection is used to invoke a
Stored Procedure. On most stored procedures this works fine since most
of them read information but when two procedures that modify the DB
with inserts or updates are invoked in a row the second procedure does
not run and reports an 25501 error.

According to DB2 documentation this is associated to:

"SQL0428N DISCONNECT cannot be issued if a connection it is directed
against has executed SQL within the unit of work.
Explanation: DISCONNECT will not be executed against a connection in
the following cases:
If SQL has been issued against the connection within the unit of work.
sqlcode: -428
sqlstate: 25501"

If we use a direct JDBC connection for each SP invocation we do not
get this error, it is when its called with the DataSource connection
that this error happens. We can't afford a new connection for every SP
we have to invoke because the AS/400 slows way down when a lot of
connections are requested and this is a very active system.

The SP that does inserts/updates set their isolation level with the
following settings:

set transaction isolation level READ UNCOMMITTED, READ WRITE;

Has anybody had this problem? and better yet: how was it solved?

Thanks.

Jun 13 '07 #1
1 3718
ha*******@gmail .com wrote:
We are running into some problems with the execution of DB2 stored
procedures when their isolation level is set to:

set transaction isolation level READ UNCOMMITTED, READ WRITE;

This is a web application running in JBoss 4.0.1 where a standard
DataSource in JBoss is defined for connections against a DB2 database
on an AS/400 (VRM = V5R2M0). The driver is established as: <driver-
class>com.ibm.a s400.access.AS4 00JDBCDriver</driver-class>, we are
using JTOpen 5.4.

The data source provides connections fine, we ask the data source to
give us a connection and then the connection is used to invoke a
Stored Procedure. On most stored procedures this works fine since most
of them read information but when two procedures that modify the DB
with inserts or updates are invoked in a row the second procedure does
not run and reports an 25501 error.

According to DB2 documentation this is associated to:

"SQL0428N DISCONNECT cannot be issued if a connection it is directed
against has executed SQL within the unit of work.
Explanation: DISCONNECT will not be executed against a connection in
the following cases:
If SQL has been issued against the connection within the unit of work.
sqlcode: -428
sqlstate: 25501"

If we use a direct JDBC connection for each SP invocation we do not
get this error, it is when its called with the DataSource connection
that this error happens. We can't afford a new connection for every SP
we have to invoke because the AS/400 slows way down when a lot of
connections are requested and this is a very active system.

The SP that does inserts/updates set their isolation level with the
following settings:

set transaction isolation level READ UNCOMMITTED, READ WRITE;

Has anybody had this problem? and better yet: how was it solved?
If this is still unresolved and -428 is returned from the server, below
is some message detail (from V5R4M0 VRM). If the connection is not at a
commit boundary when SP1 calls SP2 (and SP2 issues SET TRANSACTION..)
that might be the cause.

===wrkmsgd sql0428 qsqlmsg
Message ID . . . . . . . . . : SQL0428

Message file . . . . . . . . : QSQLMSG

Library . . . . . . . . . : QSYS

Message . . . . : SQL statement cannot be run.

Cause . . . . . : The statement cannot be run in the current
application state. A SET TRANSACTION, DISCONNECT, or SET SESSION
AUTHORIZATION statement was encountered and a connection is not at a
commit boundary.
A SET SESSION AUTHORIZATION statement was encountered and one of
the
following has occurred:

-- The SYSTEM_USER is one of the system-supplied user profiles such
as QSYS, QDFTOWN, or QSPL.

-- The current server is a local relational database and there is
an
active connection to a remote relational database.

-- A stored procedure, user-defined function, or trigger is
running.
-- Resources are being held because a COMMIT HOLD or HOLD LOCATOR

statement has been run.

-- The maximum number of ProfileHandles have been generated.

Recovery . . . : Do one of the following actions prior to running the
SQL statement. Try the request again.

-- If the connection is not at a commit boundary, issue a COMMIT or

ROLLBACK SQL statement.

-- If connections to remote relational databases are active,
disconnect the remote connections.

-- If the SYSTEM_USER is one of the system-supplied user profiles,
sign-on with a different user profile.

-- If resources are being held because a COMMIT HOLD has been run,
issue a COMMIT or ROLLBACK SQL statement.

-- If resources are being held because a HOLD LOCATOR has been run,
issue a ROLLBACK or FREE LOCATOR SQL statement.

-- If the maximum number of ProfileHandles have been generated,
release some of the ProfileHandles that are no longer needed using the
Release ProfileHandle (QSYRLSPH) program.
--
Karl Hanson
Jun 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
431
by: Srinivas B.S.S | last post by:
Hi, I am using MyODBC 3.51.06 on solaris. When a ODBC call fails to execute due to communication problems with database server, according to ODBC reference, sqlstate should be set to 08S01 (Communication link failure). But myodbc driver is setting it to HY000 in case of communication errors.
25
2499
by: MuZZy | last post by:
Hi, I'm currently rewriting some functionality which was using multithredaing for retrieving datasets from database and updating a grid control. I found that the grids (Infragistics UltraGrid, though it doesn't matter) were updated (i.e. grid.DataSource = dsDataSet;) and used for different purposes in the worker thread, so now i'm wrapping all those calls to grid's methods thru invoking which is a pain in the a$$ considering number of...
0
8256
by: Nasir | last post by:
What do we need to do to make the connection to SQL Server 2005 via JNDI? Here is what is happening: Verifying JNDI binding Datasource properties: description=empty
1
4739
by: Newie | last post by:
Hi, I have installed the Run Time Client Lite on a WIn XP computer for the ODBC driver and it works fine, I get an connection. When I installed the Client on a Win2000 computer I get this error messages: "SQL0966N The error mapping file "x " specified in the Database Connection Services directory cannot be found or cannot be opened.
5
12256
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected to the database. SQLSTATE=57030. Background: I created a linked server to DB2 8.1 database which called GRR_DB2Server. In my stored procedure p_FetchRawData, I need to read some data from this linked server GRR_DB2Server and insert them into
2
9369
by: uday123 | last post by:
Hi, We are using DB2 in an enterprise J2EE application and extracting data from here. But i get the following exception when i try to retriece records from this database: _________________________________________________________________ COM.ibm.db2.jdbc.DB2Exception: SQL0727N An error occurred during implicit system action type "1". Information returned for the error includes SQLCODE "-204", SQLSTATE "42704" and message tokens...
3
40433
by: vijay.db | last post by:
Hi Group, Getting the below error in AIX server 5.2 and my DB2 ESE is V8.1 and Fixpack 11. I'm able to successfully connect to the database and able to run a SELECT query with out any issues..If I run a UPDATE query on a table which is a part of ETL datastage job..getting the below error: Error: CLI0106E Connection is closed. SQLSTATE =
0
7907
by: carj2ee | last post by:
Hi, I have a J2EE application connecting to a mainframe DB2. I am getting the following exception in my application:- SQLCODE: -904, SQLSTATE: 57011, SQLERRMC: 00C90090;00000801;NULLID.SYSSTAT.5359534C564C3031. Can idea what this sql error message ? Thanks for the assistance. Car
4
48729
by: Pool | last post by:
I tried to connect DB2 (Sitting in Unix server at my client location) using Db2 connect V8. I am getting the following error message. I tried all the possible options BUt the error is same.. See each type belpw Standard connection failed.
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1512
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.