2 Replies Latest reply: Apr 22, 2013 9:10 AM by 422827 RSS

    BLOB Insert Issue with EclipseLink 2.3.1

    422827
      Hello,

      We have encountered a BLOB insert exception after we moved from Weblogic 10.3.5 (default with EclipseLink 2.1.3) to Weblogic 10.3.6 (default with EclipseLink 2.3.1). The same insert worked fine under EclipseLink 2.1.3. However it throws out exception every time with 2.3.1. Details are below.

      I have embedded this question in another thread but have not gotten any answer. Any suggestion would be appreciated.

      Thanks!
      Jeffrey

      EJB3.0 method to insert file attachment BLOB:
      AppAttachment has: private byte[] fileContent;
      ==================================================
      public void addFileAttachment(AppCert appCert, AppAttachment attachment,
      String userId) throws PCITDBException {
      Session session = getSessionFactory().acquireSession();

      try {
      UnitOfWork uow = session.acquireUnitOfWork();

      AppCert appCertWorkingCopy = (AppCert)uow.readObject(appCert);

      AppCertAttachment attachmentLink = new AppCertAttachment();
      attachmentLink.setAppAttachment(attachment);
      attachmentLink.setCreateDate(new Date());
      attachmentLink.setUpdateDate(new Date());
      attachmentLink.setUpdateUser(userId);
      attachmentLink.setCreateUser(userId);
      attachment.addAppCertAttachment(attachmentLink);
      appCertWorkingCopy.addAppCertAttachment(attachmentLink);

      // fix BLOB issue with weblogic jdbc driver
      ((Oracle8Platform)session.getPlatform()).setShouldUseLocatorForLOBWrite(false);

      uow.commit();
      session.release();
      } catch (Exception ex) {
      log.error("Exception occurred in addFileAttachment() ... ", ex);
      throw new PCITDBException(ex);
      } finally {
      if (session.isConnected()) {
      session.release();
      }
      }
      }
      ========================================================

      Exception during insert
      ========================================================
      <Stdout> <aphpcitpvsa06> <PCIT> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1365175142236> <BEA-000000> <[EL Warning]: 2013-04-05 10:19:02.235--UnitOfWork(-895679171)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--java.lang.NullPointerException
      at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:366)
      at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
      at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
      at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:472)
      at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
      at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
      at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:287)
      at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
      at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
      at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:743)
      at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
      at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1516)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1498)
      at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1449)
      at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224)
      at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsForClassWithChangeSet(CommitManager.java:191)
      at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:136)
      at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3799)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1415)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3143)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3124)
      at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
      at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
      at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1244)
      at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1219)
      at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:121)
      at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1355)
      at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2172)
      at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
      at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:267)
      at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:622)
      at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
      at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:52)
      at pcit.model.services.Application572_q5c5qo_Application572LocalImpl.addFileAttachment(Unknown Source)
      at view.backing.application.FileUploadBean.upload(FileUploadBean.java:115)
      ==========================================================================
        • 1. Re: BLOB Insert Issue with EclipseLink 2.3.1
          JamesSutherland
          The error occurs because getAccessors() on getExecutionSession() is returning null, but I can't see how this could happen, as there must be a write connection at this point.

          Perhaps it is something fixed, so try the latest EclipseLink release (2.4.1), or log a bug.

          Is this the only error that you get, or do other objects have errors, or is it just this one object?
          • 2. Re: BLOB Insert Issue with EclipseLink 2.3.1
            422827
            We only have issues with BLOB, and have not seen others.

            I have tried 2.4.1, and the problem still occurs. Again we don't have this problem in 2.1.3.

            We have two other applications on the same Weblogic server but using JPA implemention. They both don't have this BLOB issue with 2.3.1 (and 2.13). So maybe this is related to when using the native API?

            Jeffrey