5 Replies Latest reply: Nov 27, 2012 2:18 PM by 884628 RSS

    "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB

    884628
      I am having intermittent errors trying to insert a record into a table when using CLOB columns. Sometimes they work, sometimes they don't. When it fails, here is a sample of the error:

      <ActionListenerImpl> <processAction> oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "null".
      javax.faces.el.EvaluationException: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "null".
           at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
           at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
      <snip...>
      Caused by: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "null".
           at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8613)
           at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8467)
           at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6733)
           at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3286)
           at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3089)
           at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2093)
           at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2374)
      <snip...>
      Caused by: java.lang.NullPointerException
           at oracle.jbo.domain.ClobDomain.writeCharsToLob(ClobDomain.java:1302)
           at oracle.jbo.domain.ClobDomain.saveToDatabase(ClobDomain.java:436)
           at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8588)
      <snip...>

      It appears that the underlying cause is the NullPointerException in oracle.jbo.domain.ClobDomain.writeCharsToLob, which, of course, is in Oracle's code, not mine! I've tried seeing if there is something in the characters that causes the problem, or the length of the CLOB (not very long - a few hundred characters usually), etc., but nothing is consistent. I can run it again, and it will work the next time! The only thing that IS consistent is that if I comment out the line of code that creates the ClobDomain object and puts it into the Row, then everything works 100%.

      Here's one example of where I am setting the CLOB column:

      row.setErrorMssgTx(new ClobDomain(errorMessage.toString()));

      I suspect it might be something with the database (e.g. out of space or something - aren't CLOBs stored separate from the rest of the table's data?), but I don't know how to troubleshoot further.

      Any ideas?

      Thanks,
      Karl

      [jDev v11.1.1.5.0]
        • 1. Re: "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB
          hofespet
          Hi Karl,

          can you post the code here?
          In your case the SQL-Statement (insert) seems to be null in some cases.

          regards
          Peter
          • 2. Re: "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB
            Subramanian Meyyappan
            try debug
            "jbo.debugoutput=console"
            " -Djbo.debugoutput=console"
            you can get query being used. and then you can easily found
            • 3. Re: "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB
              884628
              Peter,

              Here's the code. It is a method defined in my application module (so 'this' refers to the application module Impl class). I'm afraid it may not be very helpful, though. All the values are passed in from elsewhere in the application. The key line is this one:

              //tran.setPayldXml(new ClobDomain(payload)); // TODO remove comment!!!! TESTING ONLY!!!

              If I uncomment the line, then I will get the intermittent errors described in the post. If I leave it commented out, then I don't get any errors. What is weird is that the "comment" field is also a CLOB object, yet it doesn't cause any issues.

              Here's the full body of the method:

              TransactionsRowImpl tran =
              (TransactionsRowImpl)this.getAllTransactions().createRow();
              this.getAllTransactions().insertRow(tran);
              tran.setTransTypeCd(transCd);
              tran.setAcctId(accountId);
              tran.setCustId(custId);
              tran.setCaseId(caseId);
              tran.setCaseCustId(caseCustId);
              tran.setStatusCd(statusCd);
              // If session is null, attempt to get current session
              if (session == null) {
              try {
              FacesContext _ctx = FacesContext.getCurrentInstance();
              if (_ctx != null)
              session =
              ((HttpSession)_ctx.getExternalContext().getSession(false)).getId();
              } catch (Exception e) {
              // If failed, just continue...
              // NOOP
              }
              }
              tran.setSssnIdTx(session);
              System.out.println("payload = " + payload); // TODO remove
              *//tran.setPayldXml(new ClobDomain(payload)); // TODO remove comment!!!! TESTING ONLY!!!*
              tran.setCreateAcctId((createAccountId == null ? ACCTID_NOUSER :
              createAccountId));
              tran.setUpdtAcctId((updateAccountId == null ? ACCTID_NOUSER :
              updateAccountId));
              tran.setErrorCd(errorCode);
              tran.setErrorTx(errorMessage);
              if (comment != null) {
              // See if comment is already formatted (starts with 'yyyy-mm-dd hh:mm:ss [xxx]'). If not, format it..
              if (!commentPat.matcher(comment).matches()) {
              comment = formatComment(null, moduleName, comment);
              }
              System.out.println("comment = " + comment); // TODO remove
              tran.setCmtTx(new ClobDomain(comment));
              }
              tran.setCmplTs(completedOn);
              tran.setGnssActionId(genesisActionId);
              tran.setIpsDocId(ipsDocId);
              tran.setCrmIntrcnId(crmInteractionId);
              tran.setSpctrmTransId(spectrumTransId);
              // Commit transaction
              this.getDBTransaction().commit();

              Thanks!
              Karl
              • 4. Re: "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB
                884628
                user707,

                I already have that debug setting turned on. For whatever reason, there is NO SQL statement being echoed for this particular INSERT attempt. I see the SQL being output for all other queries, etc., but this one apparently errors out BEFORE the actual attempt to write to the DB. So, no SQL is generated... :-(

                Thanks,
                Karl
                • 5. Re: "oracle.jbo.DMLException: JBO-26041: Failed to post data" when using CLOB
                  884628
                  So, to 'complete' this thread in case someone else stumbles upon it....

                  This is a known (but 'unpublished') bug in ADF:
                  Unpublished Bug 13092759 - AC BLOCKING: DMLEXCEPTION THROWN WHEN COMMIT DATA WITH REPLAY DRIVER ENABLED

                  The workaround is to uncheck the "Wrap Data Types" in the Advanced properties of the Datasource object in WebLogic. (see Note 1365238.1 in Oracle MetaLink for details)

                  There is NOT a patch for v11.1.1.5.0 at this time, nor have I seen any indication of what version it may be fixed in.