oracle.jbo.SQLStmtException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Support for IBM AS400
    via symmetricds by mtnbiker67
    ,
  • Here is the code that starts this. I cannot debug this with the source distributed with 4.1.6. Eclipse tells me it doesn't match the .class files. Apparently incorrect SQL is being generated. Logging produces only valid SQL after it has been generated. I am using a custom SQL dialect with one trivial modification, also below. public static void main(...) { ... LockOptions lopt = new LockOptions(); lopt.setLockMode(LockMode.PESSIMISTIC_WRITE); lopt.setTimeOut(250); lopt.setScope(false); typeDao.lock(rt, lopt); } public class Dao<T, PK> implements Serializable, GenericDao<T, PK> { ... public void lock(T o, LockOptions lopt) { beginTransaction(); session.buildLockRequest(lopt).lock(o); } private Transaction beginTransaction() { session = sessionFactory.getCurrentSession(); Transaction tx = session.getTransaction(); if (! tx.isActive()) tx.begin(); return tx; } } public class KVESQLDialect extends DB2Dialect { public KVESQLDialect() { super(); registerHibernateType(Types.CHAR, 512L, StandardBasicTypes.STRING.getName()); } } May 14, 2013 9:40:46 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: -104, SQLState: 42601 May 14, 2013 9:40:46 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: [SQL0104] Token UPDATE was not valid. Valid tokens: EXCLUSIVE. Exception in thread "main" org.hibernate.dialect.lock.PessimisticEntityLockException: could not obtain pessimistic lock at org.hibernate.dialect.lock.PessimisticWriteSelectLockingStrategy.lock(PessimisticWriteSelectLockingStrategy.java:114) at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1896) at org.hibernate.event.internal.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:99) at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:85) at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:811) at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:804) at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:172) at org.hibernate.internal.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2365) at com.kve.vanguard.model.orm.dao.Dao.lock(Dao.java:258) at com.kve.locktest.main.Main.main(Main.java:46) Caused by: org.hibernate.exception.SQLGrammarException: [SQL0104] Token UPDATE was not valid. Valid tokens: EXCLUSIVE. at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:146) at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) at sun.proxy.$Proxy21.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:84) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:71) at org.hibernate.dialect.lock.PessimisticWriteSelectLockingStrategy.lock(PessimisticWriteSelectLockingStrategy.java:75) ... 9 more Caused by: java.sql.SQLException: [SQL0104] Token UPDATE was not valid. Valid tokens: EXCLUSIVE. at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621) at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1557) at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:193) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:2025) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1824) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) ... 15 more
    via by harry clark,
  • jdbc error connecting to db2 on as400
    via by 199947,
    • oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT FIELD1, FIELD2 FROM at oracle.jbo.server.DBTransactionImpl.createPreparedStatement(DBTransactionImpl.java:3702) at oracle.jbo.server.DBTransactionImpl2.createPreparedStatement(DBTransactionImpl2.java:399) at oracle.jbo.server.DBTransactionImpl.createReUsePreparedStatement(DBTransactionImpl.java:4981) at oracle.jbo.server.ViewObjectImpl.getPreparedStatement(ViewObjectImpl.java:13391) at oracle.jbo.server.ViewObjectImpl.getPreparedStatement(ViewObjectImpl.java:13366) at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:1123) at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:913) at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:7282) at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1227) at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1078) at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2800) at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2777) at oracle.jbo.server.ViewRowSetIteratorImpl.first(ViewRowSetIteratorImpl.java:1606) at oracle.jbo.server.ViewRowSetImpl.first(ViewRowSetImpl.java:3556) at oracle.jbo.server.ViewObjectImpl.first(ViewObjectImpl.java:10288) at oracle.adf.model.binding.DCIteratorBinding.setupRSIstate(DCIteratorBinding.java:808) at oracle.adf.model.binding.DCIteratorBinding.refreshControlAndNotifyDCE(DCIteratorBinding.java:707) at oracle.adf.model.binding.DCIteratorBinding.refreshControl(DCIteratorBinding.java:676) at oracle.jbo.uicli.binding.JUIteratorBinding.refreshControl(JUIteratorBinding.java:485) at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4555) at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:347) at oracle.adf.model.binding.DCIteratorBinding.getRowSetIterator(DCIteratorBinding.java:1634) at oracle.jbo.jbotester.panel.BindingPanel.setBindingContext(BindingPanel.java:131) at oracle.jbo.jbotester.panel.OverviewPanel.setBindingContext(OverviewPanel.java:176) at oracle.jbo.jbotester.panel.BindingPanel.<init>(BindingPanel.java:101) at oracle.jbo.jbotester.panel.OverviewPanel.<init>(OverviewPanel.java:68) at oracle.jbo.jbotester.form.OverviewForm.createMasterPanel(OverviewForm.java:53) at oracle.jbo.jbotester.form.BindingForm.init(BindingForm.java:126) at oracle.jbo.jbotester.form.JTForm.<init>(JTForm.java:72) at oracle.jbo.jbotester.form.BindingForm.<init>(BindingForm.java:52) at oracle.jbo.jbotester.form.OverviewForm.<init>(OverviewForm.java:46) at oracle.jbo.jbotester.form.FormType$2.createForm(FormType.java:76) at oracle.jbo.jbotester.form.FormType.createForm(FormType.java:199) at oracle.jbo.jbotester.form.FormType.createTab(FormType.java:270) at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:248) at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:207) at oracle.jbo.jbotester.form.FormType.showForm(FormType.java:203) at oracle.jbo.jbotester.tree.ObjTreeNode.showForm(ObjTreeNode.java:135) at oracle.jbo.jbotester.tree.BindingContainerTreeNode$1.doAction(BindingContainerTreeNode.java:114) at oracle.jbo.jbotester.AbstractJboAction.actionPerformed(AbstractJboAction.java:97) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.Component.processMouseEvent(Component.java:6289) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6054) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4652) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:603) at java.awt.EventQueue$1.run(EventQueue.java:601) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:617) at java.awt.EventQueue$2.run(EventQueue.java:615) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:614) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.sql.SQLException: [SQL0104] Token <END-OF-STATEMENT> was not valid. Valid tokens: ( NEW FINAL TABLE LATERAL. at com.ibm.as400.access.JDError.throwSQLException(JDError.java:703) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:669) at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1777) at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:316) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:2166) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1965) at oracle.jbo.server.DBTransactionImpl.createPreparedStatement(DBTransactionImpl.java:3671) ... 77 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    marcbouvierdavmarcbouvierdav
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    3 more bugmates