4 Replies Latest reply on Sep 20, 2006 8:58 AM by srbox

    Oracle insert with SELECT missing

    srbox

      Hello to all,

      i'm working on some basic examples while using JBoss 4.0.4 with EJB3.0 and Oracle 10g as database. With a simple statement such as

       Location tmpLoc = new Location(street, number);
       em.persist(tmpLoc);
      


      From the client I'm getting this error:

      Exception in thread "main" java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=maric/25, BranchQual=, localId=25] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update)
      at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
      at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)


      And on the server side this:

      17:06:08,147 WARN [JDBCExceptionReporter] SQL Error: 928, SQLState: 42000
      17:06:08,147 ERROR [JDBCExceptionReporter] ORA-00928: missing SELECT keyword

      17:06:08,147 WARN [JDBCExceptionReporter] SQL Error: 928, SQLState: 42000
      17:06:08,147 ERROR [JDBCExceptionReporter] ORA-00928: missing SELECT keyword


      This happened after the em.persist() method, judging by the logs, and object creation is also ok.

      Why is there a SELECT keyword missing, when I'm using pure tables and this is a INSERT statment (just guessing, since the container is managing that part)

      tnx

        • 1. Re: Oracle insert with SELECT missing
          srbox

          Forgot to mention that the server is correctly configured and that another example like this one, only packed in a jar instead of a ear is working without problems.

          • 2. Re: Oracle insert with SELECT missing
            srbox

            Further digging into the issue, I found this in my application deployment:


            INFO [SettingsFactory] JDBC batch size: 15
            INFO [SettingsFactory] JDBC batch updates for versioned data: disabled


            ...but I still haven't found how to enable it, or how to configure my app to stop using batch update.

            • 3. Re: Oracle insert with SELECT missing
              srbox

              This is too many replys by a single person on a thread, but I found the flag to enable the batch updates for versioned data, but it didn't help.

              I'm guessing that the error is in that ORA-00928 and "select statement missing" message.

              I am getting a little bit desprite, so help the dumb newbie if you can...

              • 4. Re: Oracle insert with SELECT missing
                srbox

                Epilog:

                By accident, I finally found out what caused the error -
                Incorrect mapping of class field/method to a column (in my later case it was filed "comment" on the column "comments"). It has nothing to do with batch support and alike.

                tnx to everyone who tried to help out a noob ;)