473,604 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error SQLCODE "-811", SQLSTATE "21000"

Our web programmer was looking in his application log an found the
following error:

2006-08-31 16:33:35,129 ERROR org.hibernate.u til.JDBCExcepti onReporter
- <[IBM][CLI Driver][DB2/6000] SQL0723N An error occurred in a
triggered SQL statement in trigger "OLGCWEB.TBLPRO PS_INS_TRG".
Information returned for the error includes SQLCODE "-811", SQLSTATE
"21000" and message tokens "". SQLSTATE=09000
(JDBCExceptionR eporter.java.lo gExceptions:72)
2006-08-31 16:33:35,139 ERROR
org.hibernate.e vent.def.Abstra ctFlushingEvent Listener - <Could not
synchronize database state with session>
(AbstractFlushi ngEventListener .java.performEx ecutions:277)
org.hibernate.e xception.Generi cJDBCException: could not insert:
[ca.olgc.proline .domain.PropDO]
at
org.hibernate.e xception.SQLSta teConverter.han dledNonSpecific Exception(SQLSt ateConverter.ja va:82)
at
org.hibernate.e xception.SQLSta teConverter.con vert(SQLStateCo nverter.java:70 )
at
org.hibernate.e xception.JDBCEx ceptionHelper.c onvert(JDBCExce ptionHelper.jav a:43)
at
org.hibernate.p ersister.entity .BasicEntityPer sister.insert(B asicEntityPersi ster.java:1869)
at
org.hibernate.p ersister.entity .BasicEntityPer sister.insert(B asicEntityPersi ster.java:2200)
at
org.hibernate.a ction.EntityIns ertAction.execu te(EntityInsert Action.java:46)
at org.hibernate.e ngine.ActionQue ue.execute(Acti onQueue.java:23 9)
at
org.hibernate.e ngine.ActionQue ue.executeActio ns(ActionQueue. java:223)
at
org.hibernate.e ngine.ActionQue ue.executeActio ns(ActionQueue. java:136)
at
org.hibernate.e vent.def.Abstra ctFlushingEvent Listener.perfor mExecutions(Abs tractFlushingEv entListener.jav a:274)
at
org.hibernate.e vent.def.Defaul tFlushEventList ener.onFlush(De faultFlushEvent Listener.java:2 7)
at org.hibernate.i mpl.SessionImpl .flush(SessionI mpl.java:730)
at
ca.olgc.proline .dao.hibernate. BaseHibernateDA O.batchSaveOrUp date(BaseHibern ateDAO.java(Com piled
Code))
at
ca.olgc.proline .facade.session beans.PropicksC ardBean.addOrUp dateProPicksCar d(PropicksCardB ean.java:233)
at
ca.olgc.proline .facade.session beans.EJSLocalS tatelessPropick sCard_464a659b. addOrUpdateProP icksCard(EJSLoc alStatelessProp icksCard_464a65 9b.java:159)
at
ca.olgc.proline .facade.Proline FacadeBean.addO rUpdateProPicks Card(ProlineFac adeBean.java:78 0)
at
ca.olgc.proline .facade.EJSRemo teStatelessProl ineFacade_cc482 172.addOrUpdate ProPicksCard(EJ SRemoteStateles sProlineFacade_ cc482172.java:5 67)
at
ca.olgc.proline .facade._Prolin eFacade_Stub.ad dOrUpdateProPic ksCard(_Proline Facade_Stub.jav a:1579)
at
ca.olgc.proline .messaging.help er.DatabaseUpda teHelper.add(Da tabaseUpdateHel per.java:106)
at
ca.olgc.proline .messaging.help er.DatabaseUpda teHelper.update DB(DatabaseUpda teHelper.java:5 0)
at
ca.olgc.proline .messaging.mdb. SportsRefresher Bean.updateDB(S portsRefresherB ean.java:81)
at
ca.olgc.proline .messaging.mdb. SportsRefresher Bean.onMessage( SportsRefresher Bean.java:65)
at
com.ibm.ejs.jms .listener.MDBWr apper$Priviledg edOnMessage.run (MDBWrapper.jav a:208)
at java.security.A ccessController .doPrivileged(N ative Method)
at
com.ibm.ejs.jms .listener.MDBWr apper.callOnMes sage(MDBWrapper .java:197)
at com.ibm.ejs.jms .listener.MDBWr apper.onMessage (MDBWrapper.jav a:175)
at com.ibm.mq.jms. MQSession.run(M QSession.java(C ompiled Code))
at com.ibm.ejs.jms .JMSSessionHand le.run(JMSSessi onHandle.java:9 23)
at
com.ibm.ejs.jms .listener.Serve rSession.connec tionConsumerOnM essage(ServerSe ssion.java:739)
at
com.ibm.ejs.jms .listener.Serve rSession.onMess age(ServerSessi on.java:524)
at
com.ibm.ejs.jms .listener.Serve rSession.dispat ch(ServerSessio n.java:491)
at java.lang.refle ct.Method.invok e(Native Method)
at
com.ibm.ejs.jms .listener.Serve rSessionDispatc her.dispatch(Se rverSessionDisp atcher.java:37)
at com.ibm.ejs.con tainer.MDBWrapp er.onMessage(MD BWrapper.java:9 1)
at com.ibm.ejs.con tainer.MDBWrapp er.onMessage(MD BWrapper.java:1 27)
at com.ibm.ejs.jms .listener.Serve rSession.run(Se rverSession.jav a:373)
at com.ibm.ws.util .ThreadPool$Wor ker.run(ThreadP ool.java:681)
Caused by:
COM.ibm.db2.jdb c.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0723N An
error occurred in a triggered SQL statement in trigger
"OLGCWEB.TBLPRO PS_INS_TRG". Information returned for the error
includes SQLCODE "-811", SQLSTATE "21000" and message tokens "".
SQLSTATE=09000
at
COM.ibm.db2.jdb c.app.SQLExcept ionGenerator.th row_SQLExceptio n(SQLExceptionG enerator.java(C ompiled
Code))
at
COM.ibm.db2.jdb c.app.SQLExcept ionGenerator.th row_SQLExceptio n(SQLExceptionG enerator.java(I nlined
Compiled Code))
at
COM.ibm.db2.jdb c.app.SQLExcept ionGenerator.ch eck_return_code (SQLExceptionGe nerator.java(Co mpiled
Code))
at
COM.ibm.db2.jdb c.app.DB2Prepar edStatement.exe cute2(DB2Prepar edStatement.jav a(Compiled
Code))
at
COM.ibm.db2.jdb c.app.DB2Prepar edStatement.exe cuteUpdate(DB2P reparedStatemen t.java:1642)
at
com.ibm.ws.rsad apter.jdbc.WSJd bcPreparedState ment.executeUpd ate(WSJdbcPrepa redStatement.ja va:462)
at
org.hibernate.j dbc.NonBatching Batcher.addToBa tch(NonBatching Batcher.java:22 )
at
org.hibernate.p ersister.entity .BasicEntityPer sister.insert(B asicEntityPersi ster.java:1853)
... 33 more
2006-08-31 16:33:35,156 ERROR ca.olgc.proline .dao.hibernate. CardDAOImpl
- <Exception encountered in saveOrUpdate()( ?.java:?)

I'm not sure what this is telling me. The Db2 Administration Guide
says:

sqlcode: -811

sqlstate: 21000

SQL0817N The SQL statement cannot be executed because the statement
will result in a prohibited update operation.
Explanation: The application attempted to execute an SQL statement that
would result in updates to user data or to the subsystem catalog. This
is prohibited for one of the following reasons:

The application is running as an IMS inquiry-only transaction.
The application is an IMS or CICS application that is attempting to
update data at a remote DBMS that does not support two-phase commit.
The application is attempting to update data at multiple locations and
one of the locations does not support two-phase commit.
These SQL statements include INSERT, UPDATE, DELETE, CREATE, ALTER,
DROP, GRANT, and REVOKE.

The statement cannot be executed.

User Response: If the application is running as an IMS inquiry-only
transaction, see your IMS system programmer about changing the
inquiry-only status of the transaction under which your application is
running.

If the IMS or CICS application is attempting a remote update, either
the application must be changed to run as a local application on the
server DBMS, or the server DBMS must be upgraded to support two-phase
commit.

If the application is attempting to update data at multiple locations,
either the application must be changed, or all DBMSs involved must be
upgraded to support two-phase commit.
There's only one database involved, Here's the SQL from the trigger:

CREATE TRIGGER TBLPROPS_ins_tr g
NO CASCADE
BEFORE INSERT ON TBLPROPS REFERENCING NEW AS T1 FOR EACH ROW
MODE DB2SQL
SET T1.PROD_GROUP_T YPE_CODE = 'LOTPRPICKS',
T1.PARTICIPANT_ DESC = (SELECT TEAM_NAME FROM TBLCARDS T2,
TBLTEAMNAMES T3
WHERE T3.TEAM_ABBR = T1.PARTICIPANT and
T3.SPORT_ID = T2.SPORT_ID and
T2.CARD_ID = T1.CARD_ID and
T2.LIST_NUMBER = T1.LIST_NUMBER)

Any help greatly appreciated. DB2 UDB 7.2.

Richard

Sep 1 '06 #1
2 46719
Richard wrote:
Our web programmer was looking in his application log an found the
following error:

2006-08-31 16:33:35,129 ERROR org.hibernate.u til.JDBCExcepti onReporter
- <[IBM][CLI Driver][DB2/6000] SQL0723N An error occurred in a
triggered SQL statement in trigger "OLGCWEB.TBLPRO PS_INS_TRG".
Information returned for the error includes SQLCODE "-811", SQLSTATE
"21000" and message tokens "". SQLSTATE=09000
>(JDBCException Reporter.java.l ogExceptions:72 )
2006-08-31 16:33:35,139 ERROR
org.hibernate.e vent.def.Abstra ctFlushingEvent Listener - <Could not
synchronize database state with session>
(AbstractFlushi ngEventListener .java.performEx ecutions:277)
org.hibernate.e xception.Generi cJDBCException: could not insert:
[ca.olgc.proline .domain.PropDO]
at
[...]

I'm not sure what this is telling me. The Db2 Administration Guide
says:

sqlcode: -811

sqlstate: 21000

SQL0817N The SQL statement cannot be executed because the statement
will result in a prohibited update operation.
$ db2 "? sql0811"

SQL0811N The result of a scalar fullselect, SELECT INTO
statement, or VALUES INTO statement is more than one
row.
There's only one database involved, Here's the SQL from the trigger:

CREATE TRIGGER TBLPROPS_ins_tr g
NO CASCADE
BEFORE INSERT ON TBLPROPS REFERENCING NEW AS T1 FOR EACH ROW
MODE DB2SQL
SET T1.PROD_GROUP_T YPE_CODE = 'LOTPRPICKS',
T1.PARTICIPANT_ DESC = (SELECT TEAM_NAME FROM TBLCARDS T2,
TBLTEAMNAMES T3
WHERE T3.TEAM_ABBR = T1.PARTICIPANT and
T3.SPORT_ID = T2.SPORT_ID and
T2.CARD_ID = T1.CARD_ID and
T2.LIST_NUMBER = T1.LIST_NUMBER)
According to the error message, your subselect returns more than one row.
Of course, this cannot be handled safely. If you don't care about which
row to use, then you could apply the FETCH FIRST 1 ROW ONLY clause. If the
row matters, find the correct one.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 1 '06 #2
Thanks. :-)

Sep 1 '06 #3

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

Similar topics

11
3628
by: Rohit | last post by:
Hi, Threads in the .NET Framework 1.1 (and possibly in 1.0 also) leak "Event" handles, by Event handles I mean Win32 Event handles which can be monitored using the ProcessExplorer from www.sysinternals.com, or even simply look at the Handle count in the good old windows TaskManager. To demonstrate the problem, all I did was created a basic Win Forms application and with Main implemented as:
0
7997
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
8419
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
8406
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
8065
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
8274
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
6737
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...
1
5882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2433
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.