473,320 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.util.JDBCExceptionReporter
- <[IBM][CLI Driver][DB2/6000] SQL0723N An error occurred in a
triggered SQL statement in trigger "OLGCWEB.TBLPROPS_INS_TRG".
Information returned for the error includes SQLCODE "-811", SQLSTATE
"21000" and message tokens "". SQLSTATE=09000
(JDBCExceptionReporter.java.logExceptions:72)
2006-08-31 16:33:35,139 ERROR
org.hibernate.event.def.AbstractFlushingEventListe ner - <Could not
synchronize database state with session>
(AbstractFlushingEventListener.java.performExecuti ons:277)
org.hibernate.exception.GenericJDBCException: could not insert:
[ca.olgc.proline.domain.PropDO]
at
org.hibernate.exception.SQLStateConverter.handledN onSpecificException(SQLStateConverter.java:82)
at
org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:70)
at
org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
at
org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.java:1869)
at
org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.java:2200)
at
org.hibernate.action.EntityInsertAction.execute(En tityInsertAction.java:46)
at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:239)
at
org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:223)
at
org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:136)
at
org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:274)
at
org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:730)
at
ca.olgc.proline.dao.hibernate.BaseHibernateDAO.bat chSaveOrUpdate(BaseHibernateDAO.java(Compiled
Code))
at
ca.olgc.proline.facade.sessionbeans.PropicksCardBe an.addOrUpdateProPicksCard(PropicksCardBean.java:2 33)
at
ca.olgc.proline.facade.sessionbeans.EJSLocalStatel essPropicksCard_464a659b.addOrUpdateProPicksCard(E JSLocalStatelessPropicksCard_464a659b.java:159)
at
ca.olgc.proline.facade.ProlineFacadeBean.addOrUpda teProPicksCard(ProlineFacadeBean.java:780)
at
ca.olgc.proline.facade.EJSRemoteStatelessProlineFa cade_cc482172.addOrUpdateProPicksCard(EJSRemoteSta telessProlineFacade_cc482172.java:567)
at
ca.olgc.proline.facade._ProlineFacade_Stub.addOrUp dateProPicksCard(_ProlineFacade_Stub.java:1579)
at
ca.olgc.proline.messaging.helper.DatabaseUpdateHel per.add(DatabaseUpdateHelper.java:106)
at
ca.olgc.proline.messaging.helper.DatabaseUpdateHel per.updateDB(DatabaseUpdateHelper.java:50)
at
ca.olgc.proline.messaging.mdb.SportsRefresherBean. updateDB(SportsRefresherBean.java:81)
at
ca.olgc.proline.messaging.mdb.SportsRefresherBean. onMessage(SportsRefresherBean.java:65)
at
com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnM essage.run(MDBWrapper.java:208)
at java.security.AccessController.doPrivileged(Native Method)
at
com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage( MDBWrapper.java:197)
at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBW rapper.java:175)
at com.ibm.mq.jms.MQSession.run(MQSession.java(Compil ed Code))
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHan dle.java:923)
at
com.ibm.ejs.jms.listener.ServerSession.connectionC onsumerOnMessage(ServerSession.java:739)
at
com.ibm.ejs.jms.listener.ServerSession.onMessage(S erverSession.java:524)
at
com.ibm.ejs.jms.listener.ServerSession.dispatch(Se rverSession.java:491)
at java.lang.reflect.Method.invoke(Native Method)
at
com.ibm.ejs.jms.listener.ServerSessionDispatcher.d ispatch(ServerSessionDispatcher.java:37)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrap per.java:91)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrap per.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerS ession.java:373)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:681)
Caused by:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0723N An
error occurred in a triggered SQL statement in trigger
"OLGCWEB.TBLPROPS_INS_TRG". Information returned for the error
includes SQLCODE "-811", SQLSTATE "21000" and message tokens "".
SQLSTATE=09000
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGenerator.java(Compiled
Code))
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_S QLException(SQLExceptionGenerator.java(Inlined
Compiled Code))
at
COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_r eturn_code(SQLExceptionGenerator.java(Compiled
Code))
at
COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2 (DB2PreparedStatement.java(Compiled
Code))
at
COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeU pdate(DB2PreparedStatement.java:1642)
at
com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement. executeUpdate(WSJdbcPreparedStatement.java:462)
at
org.hibernate.jdbc.NonBatchingBatcher.addToBatch(N onBatchingBatcher.java:22)
at
org.hibernate.persister.entity.BasicEntityPersiste r.insert(BasicEntityPersister.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_trg
NO CASCADE
BEFORE INSERT ON TBLPROPS REFERENCING NEW AS T1 FOR EACH ROW
MODE DB2SQL
SET T1.PROD_GROUP_TYPE_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 46587
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.util.JDBCExceptionReporter
- <[IBM][CLI Driver][DB2/6000] SQL0723N An error occurred in a
triggered SQL statement in trigger "OLGCWEB.TBLPROPS_INS_TRG".
Information returned for the error includes SQLCODE "-811", SQLSTATE
"21000" and message tokens "". SQLSTATE=09000
>(JDBCExceptionReporter.java.logExceptions:72)
2006-08-31 16:33:35,139 ERROR
org.hibernate.event.def.AbstractFlushingEventListe ner - <Could not
synchronize database state with session>
(AbstractFlushingEventListener.java.performExecuti ons:277)
org.hibernate.exception.GenericJDBCException: 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_trg
NO CASCADE
BEFORE INSERT ON TBLPROPS REFERENCING NEW AS T1 FOR EACH ROW
MODE DB2SQL
SET T1.PROD_GROUP_TYPE_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
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.